/* Todenta — sivuston tyylit. Ei riippuvuuksia. */

:root {
  --bg: #0a1220;
  --bg-soft: #0f1b2b;
  --panel: #121f31;
  --panel-2: #16253a;
  --line: #213249;
  --text: #eef3f8;
  --text-dim: #c6d3e0;
  --text-mute: #98acc0;
  --accent: #1f8880;
  --accent-ink: #5fd3c8;
  --copper: #d59a5e;
  --holo: linear-gradient(115deg, #1f8880 0%, #5fd3c8 55%, #d59a5e 100%);
  --radius: 14px;
  --maxw: 1080px;
  --nav-h: 66px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  --nav-now: var(--nav-h);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(760px 460px at 10% -6%, rgba(31, 136, 128, .20), transparent 62%),
    radial-gradient(640px 400px at 92% 2%, rgba(213, 154, 94, .10), transparent 60%),
    radial-gradient(700px 420px at 50% 106%, rgba(95, 211, 200, .08), transparent 62%);
}

.wrap { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.16; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 0 0 22px; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.15rem); margin: 0 0 .55em; }
h3 { font-size: 1.14rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
strong { color: var(--text); font-weight: 600; }

/* ---------- Ylätunniste ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 18, 32, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 20px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { height: 26px; width: auto; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 17px; }
.nav > a {
  color: var(--text-dim);
  font-size: .9rem;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.nav > a:hover { color: var(--accent-ink); text-decoration: none; }
.nav > a.active { color: var(--text); border-bottom-color: var(--accent); }

.lang-switch { display: flex; gap: 6px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.lang-switch a {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-mute);
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 5px;
}
.lang-switch a.active { color: var(--bg); background: var(--accent-ink); }
.lang-switch a:hover { text-decoration: none; color: var(--text); }
.lang-switch a.active:hover { color: var(--bg); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  padding: 7px 11px;
  border-radius: 7px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 54px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 18px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--copper); display: inline-block; }

.holo-text {
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede { font-size: 18.5px; color: var(--text-dim); margin: 0 0 32px; max-width: 56ch; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #25998f; box-shadow: 0 8px 24px rgba(31, 136, 128, .35); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

.hero-card {
  position: relative;
  background: linear-gradient(160deg, var(--panel-2), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(360px 200px at 84% 0%, rgba(95, 211, 200, .14), transparent 68%);
}
.hero-card h3 { font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mute); margin: 0 0 18px; }
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: .93rem;
  color: var(--text-dim);
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.hero-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-card .tick { color: var(--accent-ink); font-weight: 700; flex: none; }

/* ---------- Osiot ---------- */
section { padding: 72px 0; }
.band { background: rgba(15, 27, 43, .55); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 66ch; margin-bottom: 44px; }
.section-head p { color: var(--text-dim); margin: 0; font-size: 16.5px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(31, 136, 128, .16);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.card h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 700; margin: 0 0 9px; color: var(--text); }
.card p { margin: 0; color: var(--text-dim); font-size: .94rem; }
.card p + p { margin-top: 10px; }

.card-link { display: inline-block; margin-top: 14px; font-size: .9rem; font-weight: 600; }

.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: .92rem;
  color: var(--text-dim);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .58em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent-ink);
}

/* ---------- Kerrokset ---------- */
.layers { display: grid; gap: 12px; margin-top: 34px; }
.layer {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.layer-num {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(31, 136, 128, .18);
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .92rem;
}
.layer h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: 0 0 5px; }
.layer p { margin: 0; color: var(--text-dim); font-size: .93rem; }
.layer-src { display: inline-block; margin-top: 9px; font-size: .88rem; font-weight: 600; }

/* ---------- CTA ---------- */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 38px 36px;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cta h2 { margin: 0 0 .35em; font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
.cta p { margin: 0; color: var(--text-dim); max-width: 58ch; }

/* ---------- Yhteydenottolomake ----------
   Tavoite: kortti, joka istuu CTA-lohkoon, hengittää ja toimii
   puhelimessa. Ei veny koko leveydelle, ei litisty. */

.cta.cta-form {
  display: grid;
  grid-template-columns: 1fr minmax(0, 460px);
  align-items: start;
  gap: 44px;
  padding: 40px 40px 36px;
}
.cta.cta-form > div:first-child { padding-top: 8px; }

/* Sticky-ylapalkki peittaisi ankkurilla siirryttaessa osion alun. */
#yhteys { scroll-margin-top: calc(var(--nav-h) + 24px); }

/* Vasemman palstan sisalto: pieni lista, jotta korkeus tasapainottuu
   lomakekortin kanssa. */
.cta-points {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 11px;
}
.cta-points li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-mute);
}
.cta-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .52em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-ink);
  opacity: .85;
}

/* --- Lomakekortti --- */
form[data-contact] {
  position: relative;
  display: grid;
  gap: 16px;
  background: rgba(10, 18, 32, .55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

/* Nimi + sähköposti samalle riville */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* --- Kentät --- */
.field { display: grid; gap: 6px; min-width: 0; }
.field label {
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 12px 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2398acc0' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.field textarea {
  resize: vertical;
  min-height: 104px;
  line-height: 1.6;
}
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: #2b4059; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(31, 136, 128, .18);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-mute); opacity: 1; }

/* --- Nappi --- */
.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
  gap: 8px;
  font-size: 15.5px;
  padding: 14px 20px;
}
.form-submit .btn-arrow { transition: transform .18s; }
.form-submit:hover .btn-arrow { transform: translateX(3px); }
.form-submit[disabled] { opacity: .65; cursor: progress; }
.form-submit[disabled] .btn-arrow { transform: none; }

/* --- Alaosa --- */
.form-note {
  font-size: 13px;
  line-height: 1.55;
  color: #b8c8d8;
  margin: 2px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.form-note a { color: var(--accent-ink); font-weight: 600; }
.form-note a { color: var(--accent-ink); }

/* Honeypot: piilotettu oikeilta käyttäjiltä, mutta botit löytävät sen.
   EI display:none — se on liian helppo bottien ohittaa. */
/* Honeypot: nakymaton ihmiselle, loytyy botille.
   EI display:none eika visibility:hidden — ne on liian helppo ohittaa.
   clip-path + 1px koko pitää sen renderöitynä mutta nakyvän ulkopuolella. */
.hp-field {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.form-status {
  display: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
}
.form-status.show { display: block; }
.form-status[data-state="ok"] {
  border-color: rgba(95, 211, 200, .45);
  background: rgba(31, 136, 128, .12);
  color: var(--accent-ink);
}
.form-status[data-state="error"] {
  border-color: rgba(213, 154, 94, .45);
  background: rgba(213, 154, 94, .10);
  color: var(--copper);
}

/* --- Tablet --- */
@media (max-width: 900px) {
  .cta.cta-form {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 32px 28px 28px;
  }
  .cta.cta-form > div:first-child { padding-top: 0; }
}

/* --- Puhelin --- */
@media (max-width: 560px) {
  /* Ylapalkki pysyy sticky:na, mutta ankkurisiirtyma kompensoi sen. */
  .cta.cta-form {
    padding: 26px 18px 22px;
    gap: 24px;
    border-radius: 12px;
  }
  form[data-contact] {
    padding: 20px 16px 18px;
    gap: 14px;
    border-radius: 13px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .24);
  }
  .form-row { grid-template-columns: 1fr; gap: 14px; }
  .field input,
  .field textarea,
  .field select { font-size: 16px; padding: 13px 13px; }
  .field textarea { min-height: 96px; }
  .form-submit { padding: 15px 18px; font-size: 16px; }
  .form-note { text-align: left; font-size: 12.5px; }
}

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


.site-footer { border-top: 1px solid var(--line); background: rgba(7, 13, 22, .7); padding: 48px 0 26px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.site-footer p { color: var(--text-mute); font-size: .9rem; margin: 0; max-width: 42ch; }
.site-footer h5 { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mute); margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a { color: var(--text-dim); font-size: .9rem; text-decoration: none; }
.site-footer li a:hover { color: var(--accent-ink); text-decoration: none; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
  font-size: .84rem;
}

/* ---------- Mobiili ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

/* ---------- Mobiilinavigaatio (korjattu) ----------
   Ongelmat alkuperaisessa:
   1. Kielivalinta oli valikon sisalla alimpana -> ei loydy, liian pieni kosketuskohde
   2. Valikko oli fixed eika vieritettavissa -> pitka lista katoaa ruudun alle
   3. Kielivalinta 27px korkea -> alle 44px kosketussuosituksen

   Ratkaisu: kielivalinta ylapalkkiin hampurilaisen viereen (aina nakyvissa),
   valikko vieritettavaksi, linkeille 48px kosketuskorkeus.
*/

@media (max-width: 760px) {
  /* Ylapalkki: logo | FI EN | hampurilainen */
  .site-header .container { gap: 10px; position: relative; }

  .nav-toggle {
    display: block;
    order: 3;
    margin-left: 0;
    position: relative;
    z-index: 55;
  }

  /* Kielivalinta pois valikosta, ylapalkkiin hampurilaisen viereen */
  .site-header .lang-switch {
    margin: 0 8px 0 auto;
    padding: 0;
    border: 0;
    display: flex;
    gap: 4px;
    order: 2;
  }
  .site-header .lang-switch a {
    min-width: 38px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    border-radius: 7px;
    border: 1px solid var(--line);
    color: var(--text-dim);
    background: transparent;
    padding: 0 8px;
  }
  .site-header .lang-switch a.active {
    color: var(--bg);
    background: var(--accent-ink);
    border-color: var(--accent-ink);
  }
  .site-header .lang-switch a:hover { text-decoration: none; }

  /* Valikko: vieritettava, peittava tausta, oma z-index */
  .nav {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    z-index: 49;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(0,0,0,.5);
    padding: 6px 20px 20px;
    display: none;
  }
  .nav.open {
    display: flex;
    animation: navIn .16s ease-out;
  }
  @keyframes navIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Linkit: 48px kosketuskorkeus. Teksti pysyy samassa linjassa
     aina — hover-tausta leviaa reunoille negatiivisella marginaalilla,
     jonka sisapadding kumoaa tarkalleen. */
  .nav > a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    margin: 0 -14px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
    font-size: .95rem;
    transition: background .15s, color .15s;
  }
  .nav > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    bottom: 6px;
    border-radius: 8px;
    background: transparent;
    transition: background .15s;
    z-index: -1;
  }
  .nav > a:hover,
  .nav > a:focus-visible {
    color: var(--text);
    text-decoration: none;
  }
  .nav > a:hover::after,
  .nav > a:focus-visible::after {
    background: rgba(95, 211, 200, .10);
  }
  .nav > a:active::after { background: rgba(95, 211, 200, .16); }
  .nav > a.nav-login {
    border-bottom: 0;
    color: var(--accent-ink);
    font-weight: 600;
  }
  .nav > a.nav-login:hover::after {
    background: rgba(95, 211, 200, .14);
  }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .layer { grid-template-columns: 1fr; gap: 12px; padding: 20px 18px; }
  .hero-card { padding: 24px 20px; }
}

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

/* ---------- Evästepalkki (suostumus) ---------- */
.consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  background: rgba(15, 27, 43, .97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.consent-bar.hidden { opacity: 0; transform: translateY(100%); }
.consent-bar p { margin: 0; font-size: 14.5px; color: var(--text-dim); max-width: 62ch; }
.consent-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.consent-link { font-size: 14px; color: var(--text-mute); text-decoration: underline; margin-right: 4px; }
.consent-link:hover { color: var(--text); }
.consent-btn {
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.consent-btn:hover { border-color: var(--accent); }
.consent-accept { background: var(--accent); border-color: var(--accent); color: #fff; }
.consent-accept:hover { filter: brightness(1.12); }

@media (max-width: 760px) {
  .consent-bar { padding: 14px 18px; gap: 12px; }
  .consent-bar p { font-size: 14px; }
  .consent-actions { width: 100%; justify-content: flex-end; }
}

/* Info-modalien piilotetut sisällöt — eivät koskaan näy sivulla. */
#infot-rakenteet { display: none !important; }
