/* ==========================================================================
   Valstrand Consulting — shared.css
   Zero external dependencies: no CSS framework, fonts self-hosted from /fonts/.
   Light & dark mode via tokens (html.dark, set by theme-init.js before paint).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Self-hosted fonts (SIL OFL 1.1 — licences in /fonts/). Variable fonts, so
   one file per subset covers every weight. unicode-range means latin-ext is
   only downloaded if a page actually uses those glyphs.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-ext-wght.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('/fonts/jetbrains-mono-latin-wght.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('/fonts/jetbrains-mono-latin-ext-wght.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Nordic Palette */
  --nordic-50: #f4f6f8;
  --nordic-100: #e3e8ed;
  --nordic-200: #c7d1db;
  --nordic-300: #9fb0c2;
  --nordic-400: #728aa3;
  --nordic-500: #536d88;
  --nordic-600: #41576e;
  --nordic-700: #36475a;
  --nordic-800: #2f3d4d;
  --nordic-900: #1c2530;
  --nordic-950: #0f141b;

  /* Semantic Light Theme Tokens */
  --bg-page: var(--nordic-50);
  --bg-surface: #ffffff;
  --bg-surface-alt: var(--nordic-50);
  --bg-glass-header: rgba(255, 255, 255, 0.78);
  --bg-glass-card: rgba(255, 255, 255, 0.86);
  --bg-pill: rgba(227, 232, 237, 0.85);
  --bg-pill-hover: #ffffff;

  --text-primary: var(--nordic-950);
  --text-secondary: var(--nordic-700);
  --text-muted: var(--nordic-600);
  --text-subtle: var(--nordic-500);

  --border-color: rgba(199, 209, 219, 0.75);
  --border-card: rgba(199, 209, 219, 0.9);

  --btn-primary-bg: var(--nordic-900);
  --btn-primary-text: #ffffff;
  --btn-primary-hover: var(--nordic-800);

  --accent-sky: #0369a1;
  --accent-emerald: #047857;

  --hero-gradient: linear-gradient(
    180deg,
    rgba(244, 246, 248, 0.86) 0%,
    rgba(244, 246, 248, 0.70) 52%,
    rgba(244, 246, 248, 1) 100%
  );

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* Dark Theme Token Overrides */
html.dark {
  --bg-page: var(--nordic-950);
  --bg-surface: var(--nordic-950);
  --bg-surface-alt: rgba(28, 37, 48, 0.65);
  --bg-glass-header: rgba(15, 20, 27, 0.78);
  --bg-glass-card: rgba(28, 37, 48, 0.82);
  --bg-pill: rgba(28, 37, 48, 0.85);
  --bg-pill-hover: var(--nordic-800);

  --text-primary: #ffffff;
  --text-secondary: var(--nordic-300);
  --text-muted: var(--nordic-300);
  --text-subtle: var(--nordic-400);

  --border-color: rgba(47, 61, 77, 0.75);
  --border-card: rgba(47, 61, 77, 0.9);

  --btn-primary-bg: #ffffff;
  --btn-primary-text: var(--nordic-950);
  --btn-primary-hover: var(--nordic-200);

  --accent-sky: #38bdf8;
  --accent-emerald: #34d399;

  --hero-gradient: linear-gradient(
    180deg,
    rgba(15, 20, 27, 0.86) 0%,
    rgba(15, 20, 27, 0.74) 52%,
    rgba(15, 20, 27, 1) 100%
  );
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background-color: var(--nordic-500);
  color: #ffffff;
}

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

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 72rem; /* 1152px */
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first focusable element on the page (UU requirement) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 0.875rem;
  font-weight: 500;
}

.skip-link:focus {
  top: 1rem;
}

/* Visible keyboard focus everywhere (WCAG 2.4.7) */
:focus-visible {
  outline: 2px solid var(--accent-sky);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 50;
  background-color: var(--bg-glass-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.brand:hover .brand-mark {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-subtle);
  margin-top: 0.15rem;
}

/* Quick Nav Pills */
.quick-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  background-color: var(--bg-pill);
  border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .quick-nav {
    display: flex;
  }
}

.quick-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.quick-nav-link:hover {
  background-color: var(--bg-pill-hover);
  color: var(--text-primary);
}

.dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}

.dot-sky {
  background-color: #0ea5e9;
}

.dot-emerald {
  background-color: #10b981;
}

/* Language & Theme Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem;
  border-radius: 0.5rem;
  background-color: var(--bg-pill);
  border: 1px solid var(--border-color);
}

.lang-btn {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-subtle);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.is-active {
  background-color: var(--bg-pill-hover);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.theme-btn {
  padding: 0.475rem;
  border-radius: 0.5rem;
  background-color: var(--bg-pill);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-btn:hover {
  color: var(--text-primary);
}

.icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.icon-sun {
  display: none;
}

html.dark .icon-sun {
  display: block;
}

html.dark .icon-moon {
  display: none;
}

/* ==========================================================================
   Hero Section & Coastal Background
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 6rem;
  padding-bottom: 3rem;
  overflow: hidden;
}

/* Graceful Nordic Coastal Gradient Fallback if ./media/hero-bg.jpg is missing */
.coastal-backdrop-fallback {
  background: linear-gradient(
    180deg,
    #dce4ec 0%,
    #c7d4e0 45%,
    #9fb2c4 78%,
    #7f94a8 100%
  );
}

html.dark .coastal-backdrop-fallback {
  background: linear-gradient(
    180deg,
    #0f141b 0%,
    #16202b 48%,
    #1e2b3a 80%,
    #253446 100%
  );
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  transition: transform 1s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-gradient);
  transition: background 0.3s ease;
}

.billows-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.45;
}

html.dark .billows-canvas {
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 2;
  margin-block: auto;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.hero-copy {
  max-width: 48rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--bg-glass-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--nordic-500);
  animation: pulseDot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

/* ==========================================================================
   Daughter Company Cards
   ========================================================================== */
.subsidiary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .subsidiary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.subsidiary-card {
  position: relative;
  border-radius: 1rem;
  background-color: var(--bg-glass-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background-color 0.3s ease, border-color 0.3s ease;
}

@media (min-width: 640px) {
  .subsidiary-card {
    padding: 2rem;
  }
}

.subsidiary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 32px -12px rgba(15, 20, 27, 0.14);
}

html.dark .subsidiary-card:hover {
  box-shadow: 0 20px 32px -12px rgba(0, 0, 0, 0.45);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag-sky {
  color: var(--accent-sky);
}

.tag-emerald {
  color: var(--accent-emerald);
}

.card-domain {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.card-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.card-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.05rem;
  border-radius: 0.75rem;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

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

.btn-arrow {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.subsidiary-card:hover .btn-arrow {
  transform: translateX(3px);
}

.preview-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.preview-btn:hover {
  color: var(--text-primary);
}

/* Hero Bottom Bar */
.hero-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.2s ease;
}

.scroll-link:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Parent Company Philosophy Section
   ========================================================================== */
.philosophy-section {
  padding-block: 6rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .philosophy-grid {
    grid-template-columns: 5fr 7fr;
  }
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-subtle);
}

.section-title {
  font-size: 1.875rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.section-body {
  font-size: 0.975rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .pillars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pillar-card {
  padding: 1.5rem;
  border-radius: 1rem;
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.pillar-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}

.pillar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.pillar-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding-block: 3rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-page);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
  }
}

.footer-brand {
  font-weight: 500;
  color: var(--text-primary);
}

.footer-sub {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.footer-links a {
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Modal Drawer
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 1rem;
  background-color: rgba(15, 20, 27, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 32rem;
  border-radius: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  animation: modalFadeUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html.dark .modal-dialog {
  background-color: var(--nordic-900);
}

@keyframes modalFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.modal-close-btn {
  padding: 0.4rem;
  border-radius: 0.5rem;
  color: var(--text-subtle);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close-btn:hover {
  background-color: var(--bg-pill);
  color: var(--text-primary);
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.modal-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.modal-list-bullet {
  margin-top: 0.45rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 9999px;
  background-color: var(--nordic-500);
  flex-shrink: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.btn-ghost {
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-subtle);
  transition: color 0.2s ease;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(114, 138, 163, 0.35);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(114, 138, 163, 0.6);
}
/* ==========================================================================
   CMS content states (loading skeleton / error / empty)
   Elements filled from Directus carry .cms-text. While empty they render a
   neutral placeholder bar so the layout doesn't jump when content arrives.
   ========================================================================== */
.cms-text:empty {
  display: block;
  min-height: 1em;
  border-radius: 0.375rem;
  background-color: var(--bg-pill);
  animation: skeletonPulse 1.6s ease-in-out infinite;
}

.hero-title.cms-text:empty {
  height: 2.4em;
  max-width: 32rem;
}

.hero-subtitle.cms-text:empty {
  height: 3.2em;
  max-width: 38rem;
}

.hero-badge .cms-text:empty {
  display: inline-block;
  width: 12rem;
}

.section-title.cms-text:empty {
  height: 1.3em;
  max-width: 20rem;
}

.section-body.cms-text:empty {
  height: 6em;
}

.cms-state:empty {
  display: none;
}

.cms-state {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-block: 1rem;
}

.cms-state.is-error {
  color: var(--error-color);
}

.card-skeleton {
  min-height: 15rem;
  animation: skeletonPulse 1.6s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

:root {
  --error-color: #b3261e;
}

html.dark {
  --error-color: #ff8a80;
}

/* Rich text coming from the CMS (sanitised HTML) */
.rich-text p + p {
  margin-top: 0.85rem;
}

.rich-text ul,
.rich-text ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
}

.rich-text ul {
  list-style: disc;
}

.rich-text ol {
  list-style: decimal;
}

.rich-text a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rich-text strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-sub a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-sub a:hover {
  color: var(--text-primary);
}

/* <picture> wrapper must fill the hero like the bare <img> did */
.hero-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Privacy widget (Matomo opt-out) — same behaviour as dataklart.no /
   telefonsvindel.no, styled with this site's tokens.
   ========================================================================== */
.privacy-fab {
  position: fixed;
  right: 1.125rem;
  bottom: 1.125rem;
  z-index: 55;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(15, 20, 27, 0.45);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.privacy-fab:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-1px);
}

.privacy-fab .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.privacy-panel {
  position: fixed;
  right: 1.125rem;
  bottom: 4.5rem;
  z-index: 55;
  width: min(22rem, calc(100vw - 2.25rem));
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
  animation: modalFadeUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html.dark .privacy-panel {
  background-color: var(--nordic-900);
}

.privacy-panel[hidden] {
  display: none;
}

.privacy-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.privacy-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.privacy-panel strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.privacy-subtitle {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.privacy-list {
  list-style: disc;
  margin: 0.4rem 0 0.75rem 1.1rem;
}

.privacy-toggle-btn {
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.privacy-toggle-state {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--bg-pill);
}

.privacy-toggle-btn.is-on .privacy-toggle-state {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

/* ==========================================================================
   Reduced motion — respect the OS setting (billows.js also checks it)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Anchor targets must clear the fixed 4rem header */
#selskaper,
#philosophy,
#main {
  scroll-margin-top: 5rem;
}

#main:focus {
  outline: none;
}

/* `hidden` must win over .quick-nav's display:flex (empty nav = no pill) */
.quick-nav[hidden] {
  display: none;
}

/* CMS unreachable (vc_forside failed): drop the frozen skeletons and show a
   single error message under the hero instead of one per section. */
html.cms-failed .cms-text:empty,
html.cms-failed .card-skeleton,
html.cms-failed .cms-state.is-error:not(#forside-state) {
  display: none;
}

html.cms-failed .hero-badge {
  display: none;
}

/* keep "Om morselskapet ↓" on the right even without the location label */
html.cms-failed #hero-location {
  display: inline;
  visibility: hidden;
}

/* `hidden` always wins — empty CMS fields are hidden, and that must beat
   component display rules like .cms-text:empty / .hero-badge (inline-flex). */
[hidden] {
  display: none !important;
}

/* Keep "Om bedriften ↓" on the right even when the location label is hidden */
.scroll-link {
  margin-left: auto;
}
