/* ==========================================================================
   Aplika — cases.aplika.fi
   Jaettu brändi-tyylitiedosto. Värit, typografia ja komponentit noudattavat
   Aplikan brändiohjetta (aplika-brand-style).
   ========================================================================== */

:root {
  /* ---- Ensisijainen: sininen ---- */
  --blue-dark:      #1B3A5C;
  --blue-mid:       #2E75B6;
  --blue-bright:    #0078D4;
  --blue-border:    #15304D;

  /* ---- Logo + komplementti ---- */
  --cyan:           #00B7EB;   /* vain logo + otsikon jakoviiva */
  --teal:           #1A8A7D;   /* komplementti: "nyt / ratkaisu / hyöty" */
  --teal-dark:      #147068;
  --teal-light:     #E6F5F3;

  /* ---- Valinnainen / "ennen"-korostus ---- */
  --orange:         #D4850F;
  --orange-light:   #E8A830;
  --orange-tint:    #FFF7E6;

  /* ---- Teksti + neutraalit ---- */
  --text:           #4A4A4A;
  --label:          #8C8C8C;
  --white:          #FFFFFF;
  --gray-tint:      #F5F7FA;
  --gray-light:     #F7F7F7;
  --border-light:   #D0D5DD;
  --border-lighter: #E0E0E0;
  --band:           #D0E4F0;
  --tint-navy:      #E8F4FD;
  --tint-mid:       #EBF3FA;
  --tint-bright:    #E6F2FC;

  /* ---- Typografia ---- */
  --font-heading: 'Roboto Mono', 'Courier New', monospace;
  --font-body:    'Open Sans', 'Helvetica Neue', Arial, sans-serif;

  /* ---- Layout ---- */
  --max-width:    1140px;
  --page-padding: 2rem;
  --section-gap:  4.5rem;
  --card-padding: 1.5rem;
  --card-radius:  8px;

  /* ---- Varjot ---- */
  --shadow-card:       0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading); line-height: 1.3;
  /* pitkät suomen yhdyssanat eivät saa venyttää layoutia */
  overflow-wrap: break-word; hyphens: auto;
}

a { color: var(--blue-mid); text-decoration: none; font-weight: 600; }
a:hover { color: var(--blue-dark); }

/* ==========================================================================
   LOGO
   ========================================================================== */
.aplika-logo { height: 22px; width: auto; display: block; color: #2D2D2D; }
.aplika-logo--light { color: var(--white); }

/* ==========================================================================
   NAVIGAATIO
   ========================================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.site-nav__inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0.875rem var(--page-padding);
  display: flex; align-items: center; gap: 2rem;
  min-height: 60px;
}
.site-nav__brand { flex-shrink: 0; display: flex; align-items: center; }
.site-nav__links {
  display: flex; align-items: center; gap: 0.25rem;
  margin-left: auto; flex-wrap: wrap;
}
.site-nav__links a {
  font-family: var(--font-body);
  font-size: 0.9375rem; font-weight: 600;
  color: var(--text);
  padding: 0.4rem 0.75rem; border-radius: 6px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.site-nav__links a:hover { color: var(--blue-mid); background: var(--gray-tint); }
.site-nav__links a.is-active { color: var(--blue-mid); border-bottom-color: var(--blue-mid); }

/* Caset-pudotusvalikko */
.nav-cases { position: relative; flex-shrink: 0; }
.nav-cases__trigger {
  font-family: var(--font-body);
  font-size: 0.875rem; font-weight: 600;
  color: var(--blue-mid);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: 6px; background: var(--white);
  cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: border-color 0.15s, background 0.15s;
}
.nav-cases:hover .nav-cases__trigger,
.nav-cases:focus-within .nav-cases__trigger {
  border-color: var(--blue-mid); background: var(--tint-mid);
}
.nav-cases__menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 260px; padding: 0.35rem 0;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  box-shadow: 0 8px 28px rgba(27, 58, 92, 0.14);
  z-index: 300;
}
.nav-cases::after { /* hover-silta */
  content: ''; position: absolute; right: 0; top: 100%;
  width: 100%; height: 10px;
}
.nav-cases:hover .nav-cases__menu,
.nav-cases:focus-within .nav-cases__menu { display: block; }
.nav-cases__menu a {
  display: block; padding: 0.55rem 1.1rem;
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  transition: background 0.12s, color 0.12s;
}
.nav-cases__menu a:hover { background: var(--tint-mid); color: var(--blue-mid); }
.nav-cases__menu a.is-current { color: var(--blue-mid); font-weight: 700; }
.nav-cases__menu .nav-back {
  color: var(--blue-mid); font-weight: 700;
  border-bottom: 1px solid var(--border-lighter);
  margin-bottom: 0.25rem; padding-bottom: 0.6rem;
}
.nav-cases__menu .is-soon {
  color: var(--label); pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.nav-cases__menu .is-soon::after {
  content: 'Tulossa';
  font-family: var(--font-heading); font-size: 0.625rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--orange); background: var(--orange-tint);
  border: 1px solid rgba(232, 168, 48, 0.45);
  padding: 0.05rem 0.4rem; border-radius: 3px;
}

/* ==========================================================================
   YLEISET SIVURAKENTEET
   ========================================================================== */
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--page-padding); }

.section { padding: var(--section-gap) 0; }
.section + .section { padding-top: 0; }

.eyebrow {
  font-family: var(--font-heading);
  font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--blue-mid);
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.eyebrow::before {
  content: ''; display: block; width: 22px; height: 2px; background: var(--blue-mid);
}
.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem; font-weight: 700;
  color: var(--blue-mid);
  margin-bottom: 0.5rem;
}
.section-sub {
  font-size: 0.9375rem; color: var(--text);
  max-width: 720px; margin-bottom: 2.25rem; line-height: 1.7;
}

.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-card);
}

/* Tarkastelupaneeli (klikattavien diagrammien selite) */
.info-panel {
  margin-top: 1rem; padding: 1rem 1.25rem;
  background: var(--tint-mid);
  border: 1px solid rgba(46, 117, 182, 0.28);
  border-radius: var(--card-radius);
  min-height: 54px;
  font-size: 0.875rem; line-height: 1.6; color: var(--text);
}
.info-panel__hint { color: var(--label); font-style: italic; }
.info-panel__name {
  font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--blue-dark); margin-bottom: 0.6rem;
}
.info-panel__items { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.info-panel__items li { position: relative; padding-left: 1.3rem; line-height: 1.55; }
.info-panel__items li::before {
  content: '→'; position: absolute; left: 0; color: var(--blue-mid); font-weight: 700;
}
.hi-bad  { color: var(--orange); font-weight: 700; }
.hi-good { color: var(--teal);   font-weight: 700; }

/* Kaavion kehys */
.diagram-frame {
  background: var(--gray-tint);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  position: relative;
}

/* Napit / valitsimet */
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-toggle {
  font-family: var(--font-body);
  font-size: 0.8125rem; font-weight: 600;
  padding: 0.4rem 0.95rem; border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--white); color: var(--text);
  cursor: pointer; transition: all 0.15s;
}
.btn-toggle:hover:not(.is-active) { border-color: var(--blue-mid); color: var(--blue-mid); }
.btn-toggle.is-active { background: var(--blue-mid); border-color: var(--blue-mid); color: var(--white); }
.btn-toggle:disabled { opacity: 0.35; cursor: default; }

/* Liukusäätimet */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; margin-top: 0.5rem;
  background: var(--border-light); border-radius: 2px;
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue-mid); border: 2px solid var(--white);
  box-shadow: 0 1px 5px rgba(27, 58, 92, 0.35);
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue-mid); border: 2px solid var(--white);
  box-shadow: 0 1px 5px rgba(27, 58, 92, 0.35);
}

/* Tunnisteet / teknologiapillerit */
.pill-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.pill {
  font-family: var(--font-heading);
  font-size: 0.75rem; font-weight: 500;
  padding: 0.35rem 0.85rem; border-radius: 4px;
  background: var(--tint-mid); color: var(--blue-mid);
  border: 1px solid rgba(46, 117, 182, 0.28);
}
.pill--muted {
  background: var(--gray-tint); color: var(--text);
  border-color: var(--border-light);
}

/* Tilastokortit */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.stat {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--blue-mid);
  border-radius: var(--card-radius);
  padding: 2rem 1.5rem; text-align: center;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.stat__num {
  font-family: var(--font-heading);
  font-size: 2.75rem; font-weight: 700; line-height: 1;
  color: var(--blue-dark); margin-bottom: 0.5rem;
}
.stat__label { font-size: 0.875rem; color: var(--text); line-height: 1.5; }

/* Hyötykortit */
.benefit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.benefit {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--blue-mid);
  border-radius: var(--card-radius);
  padding: 1.5rem; box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; gap: 1rem; align-items: flex-start;
}
.benefit:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.benefit__icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--tint-mid); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-mid); font-weight: 700;
}
.benefit h4 {
  font-family: var(--font-body);
  font-size: 0.9375rem; font-weight: 700;
  color: var(--blue-dark); margin-bottom: 0.35rem;
}
.benefit p { font-size: 0.875rem; color: var(--text); line-height: 1.6; }

/* Ennen / nyt -parit */
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.ps-block {
  border-radius: var(--card-radius); padding: 2rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}
.ps-block--before { background: var(--orange-tint); border-color: rgba(232, 168, 48, 0.5); }
.ps-block--after  { background: var(--tint-mid);    border-color: rgba(46, 117, 182, 0.32); }
.ps-block__label {
  font-family: var(--font-heading);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.11em;
  margin-bottom: 0.85rem;
}
.ps-block--before .ps-block__label { color: var(--orange); }
.ps-block--after  .ps-block__label { color: var(--blue-mid); }
.ps-block h3 {
  font-family: var(--font-body);
  font-size: 1.125rem; font-weight: 700; line-height: 1.4;
  color: var(--blue-dark); margin-bottom: 0.75rem;
}
.ps-block p { font-size: 0.9375rem; line-height: 1.7; color: var(--text); }

/* Check-listat */
.check-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.check-list li {
  display: flex; gap: 0.7rem; align-items: flex-start;
  font-size: 0.9375rem; line-height: 1.55; color: var(--text);
}
.check-list .ico { flex-shrink: 0; font-weight: 700; line-height: 1.55; }
.check-list .ico-bad  { color: var(--orange); }
.check-list .ico-good { color: var(--teal); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-light);
  background: var(--gray-light);
  margin-top: var(--section-gap);
}
.site-footer__inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 1.75rem var(--page-padding);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.site-footer__meta { font-size: 0.8125rem; color: var(--label); line-height: 1.6; }
.site-footer__meta a { color: var(--blue-mid); font-weight: 600; }
.site-footer__back { font-size: 0.875rem; font-weight: 600; color: var(--blue-mid); }
.site-footer__back:hover { color: var(--blue-dark); }

/* ==========================================================================
   CASE-SIVUN HERO
   ========================================================================== */
.case-hero {
  background: var(--blue-dark);
  position: relative; overflow: hidden;
}
.case-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 80% at 12% 50%, rgba(46, 117, 182, 0.5) 0%, transparent 62%),
    radial-gradient(ellipse 40% 60% at 85% 85%, rgba(0, 183, 235, 0.16) 0%, transparent 60%);
  pointer-events: none;
}
.case-hero__inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 4rem var(--page-padding) 4.5rem;
  position: relative; z-index: 1;
}
.case-hero__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.case-hero__eyebrow {
  font-family: var(--font-heading);
  font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--cyan);
  display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 1.25rem;
}
.case-hero__eyebrow::before {
  content: ''; display: block; width: 22px; height: 2px; background: var(--cyan);
}
.case-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.6vw, 2.85rem); font-weight: 700;
  line-height: 1.12; letter-spacing: -0.01em;
  color: var(--white); margin-bottom: 1.1rem;
}
.case-hero h1 em { font-style: normal; color: #8FD3F4; }
.case-hero__sub {
  font-size: 1rem; line-height: 1.75;
  color: rgba(255, 255, 255, 0.82); max-width: 520px;
}
.case-hero__stat {
  display: inline-flex; align-items: baseline; gap: 0.55rem;
  margin-top: 2rem; padding: 0.8rem 1.35rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}
.case-hero__stat b {
  font-family: var(--font-heading); font-size: 1.9rem; font-weight: 700;
  color: var(--white); line-height: 1;
}
.case-hero__stat span { font-size: 0.9375rem; color: rgba(255, 255, 255, 0.75); }
.case-hero__pills { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.75rem; }
.case-hero__pills span {
  font-family: var(--font-heading); font-size: 0.75rem;
  padding: 0.3rem 0.8rem; border-radius: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   RESPONSIIVISUUS
   ========================================================================== */
@media (max-width: 900px) {
  :root { --page-padding: 1.25rem; --section-gap: 3rem; }
  .section-title { font-size: 1.4rem; }
  .site-nav__links { display: none; }
  .site-nav__inner { gap: 1rem; }
  .nav-cases { margin-left: auto; }
  .case-hero__grid { grid-template-columns: 1fr; }
  .stat-grid, .benefit-grid, .ps-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   TULOSTUS
   ========================================================================== */
@media print {
  .site-nav, .nav-cases { display: none; }
  body { background: #fff; }
}
