:root {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #fffdfa;
  --surface-border: rgba(43, 70, 73, 0.12);
  --text: #13292b;
  --muted: #4c6265;
  --accent: #2d4491;
  --accent-strong: #1f2f68;
  --accent-soft: #dce3f7;
  --highlight: #f0a23b;
  --shadow: 0 20px 60px rgba(19, 41, 43, 0.12);
  --shadow-sm: 0 8px 24px rgba(19, 41, 43, 0.07);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(45, 68, 145, 0.08), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(45, 68, 145, 0.1), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 52%, #f6f8fd 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 85%);
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { left: 16px; }

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 56px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 12px 12px 18px;
  background: rgba(255, 253, 250, 0.82);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  position: sticky;
  top: 16px;
  z-index: 30;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.brand-text { font-size: 1.05rem; }

.header-actions,
.site-nav,
.language-switcher,
.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-nav { gap: 4px; }

.site-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a:hover { background: rgba(45, 68, 145, 0.07); color: var(--text); }

.site-nav a.is-current { background: var(--accent-soft); color: var(--accent-strong); }

.nav-toggle {
  display: none;
  border: 1px solid var(--surface-border);
  background: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.lang-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lang-button.is-active { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  line-height: 1.05;
  max-width: 18ch;
}

h2 { font-size: clamp(1.8rem, 2.6vw, 2.6rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }

p { margin: 0; line-height: 1.7; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 800;
}

.lead,
.hero-text,
.section-heading > p:last-child {
  margin-top: 18px;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 64ch;
}

/* ---------- Hero ---------- */

.hero { padding: 72px 0 40px; }
.hero-copy { max-width: 820px; }
.hero--compact { padding: 56px 0 28px; }

.hero-actions { margin-top: 30px; flex-wrap: wrap; }

.hero-points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-points li {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(43, 70, 73, 0.1);
  color: var(--text);
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  border: 0;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible,
.lang-button:hover,
.lang-button:focus-visible { transform: translateY(-1px); }

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(45, 68, 145, 0.26);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border: 1px solid rgba(43, 70, 73, 0.16);
}

/* ---------- Sections & cards ---------- */

.content-section { padding: 44px 0; }

.section-heading { max-width: 760px; margin-bottom: 26px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.feature-card,
.benefit-item,
.contact-card,
.portal-card,
.service-card,
.spec-card {
  background: #ffffff;
  border: 1px solid rgba(19, 41, 43, 0.08);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  border-radius: var(--radius-lg);
  color: var(--text);
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.feature-card p,
.benefit-item p,
.portal-copy p,
.service-card p,
.spec-card p { margin-top: 14px; color: var(--muted); }

.benefit-list { display: grid; gap: 18px; }

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
}

/* Service cards (homepage) */

.service-card {
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

a.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.service-card .service-link {
  margin-top: 18px;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
}

.service-card .service-link::after { content: " →"; }

/* Stats */

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(19, 41, 43, 0.08);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  display: block;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 2.4vw, 2.3rem);
  color: var(--accent-strong);
  line-height: 1.1;
}

.stat-label { display: block; margin-top: 8px; color: var(--muted); font-size: 0.95rem; }

/* Logo row */

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-chip {
  padding: 12px 20px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(19, 41, 43, 0.08);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Video & portal (mobiilivaihde page) */

.video-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(19, 41, 43, 0.08);
  box-shadow: var(--shadow);
}

.marketing-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  background: #000000;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.portal-card { padding: 18px; }

.portal-image {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 22px;
  border: 1px solid rgba(43, 70, 73, 0.08);
  background: #ffffff;
}

.portal-copy { padding: 10px; }

.portal-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-copy h3 { margin-top: 14px; }

/* Spec list (SIP trunk page) */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.spec-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

/* Steps */

.step-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-list li {
  counter-increment: step;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(19, 41, 43, 0.08);
  box-shadow: var(--shadow-sm);
}

.step-list li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: "Sora", sans-serif;
  font-weight: 700;
}

.step-list h3 { font-size: 1.05rem; }
.step-list p { margin-top: 10px; color: var(--muted); font-size: 0.97rem; }

/* Contact */

.contact-section { padding-top: 24px; }

.contact-card { position: relative; overflow: hidden; }

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(240, 162, 59, 0.12), transparent 40%);
  pointer-events: none;
}

.contact-card > * { position: relative; }
.contact-actions { margin-top: 24px; flex-wrap: wrap; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.contact-grid dt { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.contact-grid dd { margin: 8px 0 0; color: var(--muted); line-height: 1.8; }
.contact-grid a:hover { color: var(--accent); }

/* ---------- Legal / prose pages ---------- */

.prose {
  max-width: 76ch;
  background: #ffffff;
  border: 1px solid rgba(19, 41, 43, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(24px, 4vw, 48px);
}

.prose h2 { font-size: 1.5rem; margin-top: 40px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1rem; margin-top: 26px; }
.prose p, .prose ul, .prose ol { margin-top: 14px; color: var(--muted); }
.prose ul, .prose ol { padding-left: 22px; line-height: 1.8; }
.prose li { margin-top: 6px; }
.prose a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); }

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.prose table {
  width: 100%;
  min-width: 540px;
  margin-top: 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose .table-wrap + p { margin-top: 14px; }

.prose th, .prose td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(19, 41, 43, 0.1);
  vertical-align: top;
  color: var(--muted);
}

.prose th { color: var(--text); font-weight: 800; background: rgba(45, 68, 145, 0.04); }

.doc-meta {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.notice {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(240, 162, 59, 0.12);
  border: 1px solid rgba(240, 162, 59, 0.35);
}

.notice p { color: var(--text); }

/* ---------- Footer ---------- */

.site-footer {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 32px 0 40px;
  border-top: 1px solid var(--surface-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.1fr 1fr;
  gap: 32px;
}

.footer-grid h2 {
  font-size: 1rem;
  font-family: "Sora", sans-serif;
  letter-spacing: 0.02em;
}

.site-footer p,
.site-footer li { color: var(--muted); font-size: 0.95rem; line-height: 1.8; }

.site-footer ul { list-style: none; margin: 12px 0 0; padding: 0; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .footer-block > p { margin-top: 12px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-border);
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(100% - 40px, 520px);
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(19, 41, 43, 0.1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  z-index: 40;
}

.cookie-copy strong { display: block; margin-bottom: 8px; font-family: "Sora", sans-serif; }
.cookie-copy p { color: var(--muted); font-size: 0.95rem; }
.cookie-copy a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .feature-grid--three,
  .step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .site-header {
    flex-wrap: wrap;
    border-radius: 28px;
    padding: 12px 14px;
  }

  .site-nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--surface-border);
    margin-top: 4px;
  }

  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 16px; }

  .split-section,
  .feature-grid,
  .feature-grid--three,
  .portal-grid,
  .spec-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .hero { padding-top: 48px; }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 14px;
  }

  .site-header { position: static; }

  .step-list,
  .stat-band,
  .footer-grid { grid-template-columns: 1fr; }

  .feature-card,
  .benefit-item,
  .contact-card,
  .spec-card,
  .service-card { padding: 22px; }

  .button { width: 100%; }

  .cookie-actions { flex-wrap: wrap; }
  .site-footer { width: min(calc(100% - 20px), var(--max-width)); }
}

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

/* ---------- Contact form ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 28px;
  align-items: start;
}

.form-panel,
.contact-aside {
  background: #ffffff;
  border: 1px solid rgba(19, 41, 43, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(22px, 3vw, 36px);
}

.form-panel h2,
.contact-aside h2 { font-size: 1.4rem; }

.form-intro { margin-top: 10px; color: var(--muted); font-size: 0.97rem; }

.lead-form { margin-top: 24px; display: grid; gap: 18px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field { display: grid; gap: 8px; }

.field label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.field .req { color: var(--accent); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(19, 41, 43, 0.18);
  background: #fff;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 68, 145, 0.16);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #b3261e;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
}

.field-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
}

.field-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.field-check label { font-weight: 500; color: var(--muted); line-height: 1.6; }
.field-check label a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* spam trap — hidden from people, not from bots */
.field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions { margin-top: 4px; }

.form-status {
  min-height: 1.4em;
  font-weight: 600;
  color: var(--muted);
}

.form-status.is-error { color: #b3261e; }
.form-status.is-ok { color: #14663f; }

.lead-form.is-sending { opacity: 0.72; pointer-events: none; }

.form-sent {
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(20, 102, 63, 0.08);
  border: 1px solid rgba(20, 102, 63, 0.28);
  font-weight: 600;
}

.contact-grid--stack { grid-template-columns: 1fr; margin-top: 20px; }

@media (max-width: 960px) {
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

.next-steps {
  list-style: none;
  counter-reset: step;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.next-steps li {
  counter-increment: step;
  display: grid;
  gap: 4px;
  padding-left: 42px;
  position: relative;
}

.next-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

.next-steps strong { font-family: "Sora", sans-serif; font-size: 1rem; }
.next-steps span { color: var(--muted); font-size: 0.95rem; line-height: 1.65; }

/* ---------- Touch target sizing ----------
   WCAG 2.5.5 / Apple HIG want ~44px. Inline links inside sentences are exempt,
   but standalone controls are not. */

.lang-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle { min-height: 44px; }

.brand { min-height: 44px; }

.field-check input {
  width: 24px;
  height: 24px;
  margin-top: 0;
}

.field-check label { padding: 2px 0; }

@media (max-width: 860px) {
  /* the eyebrow label was 12.8px — under the comfortable reading floor on a phone */
  .eyebrow { font-size: 0.86rem; }

  .site-nav a { min-height: 48px; display: flex; align-items: center; }

  /* standalone contact links become tappable rows rather than 21px text */
  .site-footer li { line-height: 2.2; }
  .site-footer li a,
  .contact-grid dd a,
  .contact-aside dd a,
  .cookie-copy a {
    display: inline-block;
    padding: 8px 0;
  }

  .footer-bottom { gap: 12px 20px; }
}

/* ---------- Long Finnish compounds on narrow screens ----------
   Words like "operaattoripalvelut" and "puhelinjärjestelmä" are wider than a
   phone at display sizes, so headings need to be allowed to break and the
   floor of the clamp has to come down. */

h1, h2, h3, h4 {
  overflow-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 640px) {
  h1 { font-size: clamp(1.75rem, 7.2vw, 2.4rem); line-height: 1.12; }
  h2 { font-size: clamp(1.45rem, 5.6vw, 2rem); }
  h3 { font-size: 1.08rem; }
  .hero-text, .lead, .section-heading > p:last-child { font-size: 1rem; }
}

@media (max-width: 380px) {
  h1 { font-size: clamp(1.55rem, 6.8vw, 2rem); }
}
