/* KJM Consult Oy — Design System Tokens & Component Library */

/* ═══════════════════════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* surfaces — warm, light, architectural */
  --bg: #faf9f6;
  --surface-low: #f1efe9;
  --surface-card: #ffffff;
  --surface-dim: #e2ded4;
  --ink-deep: #15211f;
  
  /* ink */
  --ink: #232b29;
  --ink-muted: #5c6562;
  --ink-faint: #8b918d;
  
  /* brand — deep petrol primary, refined */
  --primary: #1d4d4a;
  --primary-dim: #143836;
  --primary-tint: #e6efed;
  --accent-teal: #2f9c93;
  --accent-clay: #bd7b4f;
  --success: #2f9c93;
  
  /* typography */
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  
  /* radii */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  
  /* spacing scale (8pt grid) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;
  
  /* elevation */
  --shadow-ambient: 0 16px 48px rgba(21, 33, 31, 0.08);
  --backdrop-blur: 20px;
  
  /* container */
  --container: 1280px;
}

/* ═══════════════════════════════════════════════════════════════
   BASE RESET
   ═══════════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

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

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

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.7;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT PRIMITIVES
   ═══════════════════════════════════════════════════════════════ */

.container {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.section {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.section--low {
  background: var(--surface-low);
}

.section--dark {
  background: var(--ink-deep);
  color: white;
}

@media (max-width: 768px) {
  .section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 150ms ease;
  white-space: nowrap;
  min-height: 44px;
}

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--primary:hover {
  transform: translateY(-1px);
  background: var(--primary-dim);
  box-shadow: 0 10px 28px rgba(29, 77, 74, 0.22);
}

.btn--secondary {
  background: var(--surface-card);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(42, 52, 55, 0.1);
}

.btn--secondary:hover {
  box-shadow: 0 0 0 1px rgba(42, 52, 55, 0.2), var(--shadow-ambient);
}

.btn--ghost {
  background: transparent;
  color: white;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.3);
}

.btn--ghost:hover {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

.btn--dark {
  background: var(--ink-deep);
  color: white;
}

.btn--dark:hover {
  background: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════
   CHIPS & BADGES
   ═══════════════════════════════════════════════════════════════ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background: var(--surface-low);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.chip--teal {
  background: rgba(47, 156, 147, 0.12);
  color: #1f7b73;
  font-weight: 600;
}

.chip--blue {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}

.chip--success {
  background: rgba(47, 156, 147, 0.12);
  color: #1f7b73;
}

.chip::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.chip.no-dot::before {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 250ms ease;
}

.card:hover {
  box-shadow: var(--shadow-ambient);
}

.card__header {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-dim);
  font-weight: 600;
  color: var(--ink);
}

.card__body {
  padding: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 250ms ease;
}

.compliance-ticker {
  height: 2rem;
  background: var(--surface-low);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.header-nav {
  height: 4.5rem;
  backdrop-filter: blur(var(--backdrop-blur));
  background: rgba(248, 250, 251, 0.8);
  border-bottom: 1px solid rgba(42, 52, 55, 0.06);
}

.header-nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
}

.header-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.header-logo__tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  margin-top: 0.125rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 150ms ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1.125rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

@media (max-width: 968px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════════════════
   HERO — single, light, full-width
   ═══════════════════════════════════════════════════════════════ */

.hero {
  margin-top: 6.5rem;
  background: var(--bg);
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(3rem, 5vw, 4.5rem);
  position: relative;
  overflow: hidden;
}

/* faint architectural grid wash, very light */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(29, 77, 74, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(29, 77, 74, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  margin-bottom: var(--space-3);
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 5.5vw, 4.75rem);
  line-height: 1.04;
  color: var(--ink-deep);
  margin-bottom: var(--space-3);
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero__lede {
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.hero__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* dual-pillar band — equal weight for both business lines */
.hero__pillars {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: clamp(3rem, 5vw, 4.5rem) auto 0;
  padding: 0 var(--space-4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.hero-pillar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--surface-dim);
  border-radius: var(--radius-xl);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.hero-pillar:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-ambient);
  border-color: transparent;
}

.hero-pillar__tag {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.hero-pillar h3 {
  font-size: 1.375rem;
  color: var(--ink);
}

.hero-pillar p {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  flex: 1;
}

.hero-pillar__link {
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primary);
}

.hero-pillar--floors .hero-pillar__tag {
  color: #1f7b73;
}

.hero-pillar--floors .hero-pillar__link {
  color: #1f7b73;
}

@media (max-width: 768px) {
  .hero__pillars {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PARTNER STRIP
   ═══════════════════════════════════════════════════════════════ */

.partner-strip {
  height: 3.5rem;
  background: var(--surface-low);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: 0 var(--space-4);
  overflow-x: auto;
}

.partner-strip__item {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   GRID SYSTEMS
   ═══════════════════════════════════════════════════════════════ */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-8);
}

.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-8);
}

@media (max-width: 968px) {
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.desaturate {
  filter: grayscale(90%);
  transition: filter 700ms ease;
}

.desaturate:hover {
  filter: grayscale(0%);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .desaturate {
    transition: none;
  }
  
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   SHARED PAGE COMPONENTS (footer, final CTA, resources)
   Used on every template. In the original static design these lived only
   in the homepage's inline <style>; centralised here so all pages match.
   ═══════════════════════════════════════════════════════════════ */

/* Resources */
.resources {
  padding: 4rem 0;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.resource-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 250ms ease;
}

.resource-card:hover {
  box-shadow: var(--shadow-ambient);
  transform: translateY(-2px);
}

.resource-card__thumb {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--surface-low);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.resource-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.resource-card p {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

/* Final CTA */
.final-cta {
  padding: 6rem 4rem;
  background: var(--primary-tint);
  color: var(--ink-deep);
  text-align: center;
}

.final-cta h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.final-cta p {
  font-size: 1.125rem;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.final-cta__actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  background: var(--ink-deep);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 150ms ease;
}

.footer-col a:hover {
  color: white;
}

.footer-legal {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 968px) {
  .resources-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile nav drawer (toggle wired in main.js) */
@media (max-width: 968px) {
  body.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: fixed;
    inset: 6.5rem 0 auto 0;
    background: var(--bg);
    padding: var(--space-4);
    box-shadow: var(--shadow-ambient);
    z-index: 999;
  }
}

/* Active nav state for WordPress menus (mirrors .nav-links a.active) */
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a,
.nav-links .current-menu-parent > a,
.nav-links .current-post-ancestor > a {
  color: var(--ink);
}

.nav-links .current-menu-item > a::after,
.nav-links .current_page_item > a::after,
.nav-links .current-menu-parent > a::after {
  content: '';
  position: absolute;
  bottom: -1.125rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}
