/* ============================================================
   Softavipu — simple dark theme
   Colors and fonts are defined as variables below; change them
   in one place and the whole site updates.
   ============================================================ */

:root {
  /* Backgrounds (dark navy shades) */
  --bg: #0f1420;
  --bg-raised: #171e2e;
  --border: #26304a;

  /* Text */
  --text: #e7eaf2;
  --text-muted: #9aa4ba;

  /* Accent (business blue) */
  --accent: #5b8def;
  --accent-soft: #5b8def26; /* accent at ~15% opacity */

  --max-width: 60rem;
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  /* Paint above page content: bullet lists use position: relative for
     their dots, and without this they would overlap the sticky header. */
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* LinkedIn "in" bug in the header; keeps the nav row height stable,
   since the icon box is as tall as the text links. */
.linkedin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0;
}

.linkedin-badge img { display: block; }

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

.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(180deg, var(--accent-soft), transparent 70%);
}

.hero h1 {
  margin: 0 0 1rem;
  max-width: 34rem;
}

.hero-lead {
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 0.4rem;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.1);
}

/* ---------- Sections ---------- */

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
  /* Keep section headings visible below the sticky header when
     navigating with the menu links. */
  scroll-margin-top: 4.5rem;
}

.section h2 { margin: 0 0 0.75rem; }

/* Price line inside service cards */
.price {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.price + p { margin-top: 0; }

/* Bulleted contents inside service cards */
.card-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.card-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.45rem;
}

.card-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

/* Small heading inside a service card (e.g. "Erikseen veloitettavia
   lisäpalveluita:") — above a card-list. Specificity is raised
   (.card p.card-label) for the same reason as .card p.card-note
   below: otherwise .card p { margin: 0 } would override the bottom
   margin. */
.card p.card-label {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Small print near the end of a service card (above the CTA button).
   Specificity is raised (.card p.card-note) so that the generic
   .card p { margin: 0 } rule does not override the bottom margin
   that separates the note from the CTA button. */
.card p.card-note {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.section-lead {
  color: var(--text-muted);
  max-width: 42rem;
  margin-bottom: 2rem;
}

/* ---------- Cards (services) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1.5rem;
  /* Flex column so that the CTA button can be pinned to the bottom
     edge, keeping the buttons aligned across a grid row. */
  display: flex;
  flex-direction: column;
}

/* Varaa otsikolle tilaa kahdelle riville, jotta hintarivi ja muu
   sisältö alkavat samalta korkeudelta vierekkäisissä korteissa,
   vaikka osa otsikoista rivittyisi kahdelle riville ja osa ei. */
.card h3 {
  margin-top: 0;
  min-height: calc(2 * 1.2rem * 1.25); /* kaksi riviä h3-tekstiä */
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

/* CTA button at the bottom of each service card. Points to the same
   address as the hero button. margin-top: auto pushes the button to
   the card's bottom edge when the cards in a row have different
   content heights. */
.card-cta {
  margin-top: auto;
  align-self: flex-start;
}

/* ---------- Credentials ("Meistä" section) ---------- */

.fact {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem 1.25rem;
}

/* Abbreviation-style badge (CIPP/E, CIPM, ft...) */
.fact-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.fact-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

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

.contact-note {
  margin: 1.75rem 0 0;
  max-width: 42rem;
  color: var(--text-muted);
}

.contact-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  max-width: 30rem;
}

.contact-list dt {
  color: var(--text-muted);
  font-weight: 600;
}

.contact-list dd { margin: 0; }

/* LinkedIn row in the contact list: icon aligned with the text */
.linkedin-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.linkedin-contact img { display: block; }

/* ---------- Document pages (tietosuojaseloste) ---------- */

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.doc-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.doc h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.35rem;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li { margin-bottom: 0.5rem; }

.doc address {
  font-style: normal;
  line-height: 1.6;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* "Meistä" section: portrait on the left, intro and 2×2 credential
   badges on the right. Stacks vertically on small screens. */
.about-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.portrait {
  flex-shrink: 0;
  width: 18rem;
  max-width: 45%;
  height: auto;
  border-radius: 0.6rem;
}

.about-text {
  flex: 1;
  min-width: 0;
}

.about-lead { margin-bottom: 1.5rem; }

#about .grid {
  grid-template-columns: repeat(2, 1fr);
}

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  h1 { font-size: 2rem; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Keep the badge next to the links on mobile */
  .site-nav { align-items: center; }

  .linkedin-badge {
    margin-left: 0.25rem;
    align-self: center;
  }

  .contact-list {
    grid-template-columns: 1fr; /* stack label above value */
  }

  .contact-list dd { margin-bottom: 0.75rem; }

  .about-layout {
    flex-direction: column;
  }

  .portrait {
    width: 14rem;
    max-width: 60%;
  }
}
