/* Intrust Assignment Oy
   One stylesheet for index.html and tietosuoja.html.
   Tokens first, then base, then components. Dark mode via prefers-color-scheme. */

@font-face {
  font-family: 'Red Hat Display';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(fonts/RedHatDisplay.woff2) format('woff2');
}

:root {
  color-scheme: light dark;

  /* Brand (unchanged from the original site) */
  --navy: #001662;
  --navy-deep: #000F45;
  --brand: #0D54FF;

  /* Light theme */
  --bg: #F9FAFE;
  --bg-alt: #EDF1FC;
  --text: #0A1C4B;
  --muted: #43507A;
  --line: #D3DBF1;
  --link: #0A47D6;
  --rule: #0D54FF;

  /* On navy surfaces (hero, footer) */
  --on-navy: #F4F7FF;
  --on-navy-muted: #C5D1F5;
  --focus: #9CC4FF;

  /* One radius for the whole site */
  --r: 4px;

  --section: clamp(64px, 9vw, 112px);
  --measure: 65ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1230;
    --bg-alt: #0F1944;
    --text: #E8EDFB;
    --muted: #A8B5DA;
    --line: #25346A;
    --link: #86AAFF;
    --rule: #4D80FF;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  font-family: 'Red Hat Display', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r);
}

.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #F9FAFE; color: var(--navy);
  padding: 12px 16px; font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; }

/* Hero (also the compact header on the privacy page) */
.hero {
  background: var(--navy);
  color: var(--on-navy);
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 80px; padding-block: 7px;
}
.bar img { width: 168px; }
.bar a {
  color: var(--on-navy);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px; display: inline-flex; align-items: center;
  border-bottom: 2px solid transparent;
  transition: border-color .18s ease;
}
.bar a:hover, .bar a:focus-visible { border-bottom-color: currentColor; }

.hero-copy { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.hero h1 {
  font-size: clamp(33px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 900;
  max-width: 14em;
}
.lead {
  margin: 24px 0 36px;
  max-width: 30em;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.4;
  font-weight: 500;
  color: var(--on-navy-muted);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px;
  background: #F4F7FF; color: var(--navy);
  font: inherit; font-weight: 800; text-decoration: none; white-space: nowrap;
  border-radius: var(--r);
  transition: background-color .18s ease, transform .18s ease;
}
.btn:hover { background: #D9E4FF; }
.btn:active { transform: translateY(1px); }

/* Sections */
.section { padding-block: var(--section); }
.section--alt { background: var(--bg-alt); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }

.section h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  max-width: 20em;
  margin-bottom: 24px;
}
.section p { max-width: var(--measure); }
.section h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  margin: 40px 0 16px;
  color: var(--muted);
}

/* Why they were contacted: the question most visitors arrive with */
.section .pledge {
  margin: 36px 0 0;
  padding-left: 24px;
  border-left: 4px solid var(--rule);
  max-width: 34ch;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Services: four plain items, ruled from above */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
}
.services li {
  border-top: 3px solid var(--rule);
  padding-top: 16px;
  font-size: 20px; line-height: 1.3; font-weight: 800;
}

/* Copart section */
.split {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 96px);
  align-items: start;
}
.split h3 { margin-top: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 14px 0; font-weight: 500; }
.plain-list li + li { border-top: 1px solid var(--line); }

/* Facts */
.facts {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
}
.facts li {
  border-top: 3px solid var(--rule);
  padding-top: 16px;
  font-size: clamp(22px, 2.3vw, 28px); line-height: 1.2; font-weight: 800; letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Footer */
.footer { background: var(--navy); color: var(--on-navy); padding-top: var(--section); }
.footer h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; }
.footer .org { margin: 12px 0 40px; font-size: 20px; font-weight: 700; }
.footer a { color: var(--on-navy); text-underline-offset: 3px; }
.contact {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column;
  gap: 28px 64px;
  margin: 0 0 var(--section); max-width: 760px;
}
.contact dt { font-size: 14px; font-weight: 700; color: var(--on-navy-muted); margin-bottom: 4px; }
.contact dd { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.5; }
.contact address { font-style: normal; }
.contact a { display: inline-block; min-height: 44px; line-height: 44px; }

.bottom { background: var(--navy-deep); color: var(--on-navy-muted); font-size: 14px; padding-block: 16px; }
.bottom .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 32px; }
.bottom a { color: var(--on-navy); display: inline-flex; align-items: center; min-height: 44px; }

/* Privacy page */
.hero--doc .hero-copy { padding: clamp(32px, 5vw, 56px) 0 clamp(40px, 6vw, 64px); }
.hero--doc h1 { font-size: clamp(34px, 5vw, 52px); max-width: none; }
.doc-date { margin: 12px 0 0; color: var(--on-navy-muted); }
.wrap--doc { width: min(860px, calc(100% - 48px)); }
.legal { padding-block: clamp(40px, 6vw, 64px); }
.legal h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 800; margin: 44px 0 10px; max-width: none; }
.legal p, .legal li { font-size: 17px; max-width: none; }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.note { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; margin: 0 0 8px; }
.note p { margin: 0; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 16px; table-layout: fixed; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border: 1px solid var(--line); overflow-wrap: anywhere; hyphens: auto; }
th { background: var(--bg-alt); font-weight: 700; }

/* Tablet */
@media (max-width: 960px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

/* Mobile: every multi-column layout collapses to one column */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap, .wrap--doc { width: calc(100% - 32px); }
  .bar img { width: 132px; }
  .services, .facts { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .btn { width: 100%; }
  .pledge { padding-left: 18px; }
  .legal p, .legal li { font-size: 16px; }
  .legal h2 { font-size: 21px; margin: 34px 0 8px; }
  .bottom .wrap { flex-direction: column; }
  .contact { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }

  table, thead, tbody, tr, th, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  table { margin: 18px 0; }
  tbody { display: grid; gap: 14px; }
  tr { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
  td { border: 0; padding: 11px 14px 13px; }
  td + td { border-top: 1px solid var(--line); }
  td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 13px; font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@media print {
  .hero { background: none; color: var(--text); }
  .bar a, .bottom { display: none; }
  a { color: inherit; text-decoration: underline; }
}
