/* Spasi Zhivot — modern responsive stylesheet
 * Warm off-white palette, consistent red accents, line-icon glyphs on
 * tinted badges, 16:9 photo frames, manual light/dark theme via
 * [data-theme] on <html> (set synchronously by theme.js before paint).
 */
:root {
  /* Red accent — unchanged */
  --color-primary: #d92d20;
  --color-primary-dark: #a91f15;
  --color-primary-light: #fef2f2;

  /* Neutrals: warm off-white family (stone/neutral scale) */
  --color-text: #1c1917;
  --color-text-muted: #57534e;
  --color-text-subtle: #78716c;
  --color-bg: #ffffff;
  --color-bg-alt: #fafaf9;
  --color-bg-soft: #f5f5f4;
  --color-border: #e7e5e4;
  --color-border-strong: #d6d3d1;

  --color-accent: #1c1917;
  --color-focus: #2563eb;
  --color-warning-bg: #fff7ed;
  --color-warning-border: #ea580c;
  --color-warning-text: #7c2d12;

  --shadow-xs: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, .06), 0 1px 2px rgba(28, 25, 23, .04);
  --shadow-md: 0 10px 25px -5px rgba(28, 25, 23, .07), 0 4px 10px -4px rgba(28, 25, 23, .05);
  --shadow-lg: 0 25px 50px -12px rgba(28, 25, 23, .18);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --container: 1180px;
  --container-narrow: 780px;
  --header-height: 72px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-primary: #fb7185;
  --color-primary-dark: #f43f5e;
  --color-primary-light: rgba(251, 113, 133, .14);

  --color-text: #fafaf9;
  --color-text-muted: #a8a29e;
  --color-text-subtle: #78716c;
  --color-bg: #18181b;
  --color-bg-alt: #27272a;
  --color-bg-soft: #3f3f46;
  --color-border: #3f3f46;
  --color-border-strong: #52525b;

  --color-accent: #fafaf9;
  --color-warning-bg: rgba(234, 88, 12, .12);
  --color-warning-text: #fdba74;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, .55);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* Keep inputs/textareas selectable so any future form still works. */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

img, svg { max-width: 100%; height: auto; display: block; }
img[loading="lazy"] { background: var(--color-bg-alt); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color .2s ease;
}
a:hover { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--color-text);
}
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
p.lead { font-size: 1.15rem; color: var(--color-text-muted); }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .35em; }
li::marker { color: var(--color-primary); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 2.5rem 0; }

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

/* ---------- Icon system ---------- */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: currentColor;
  vertical-align: middle;
}
.icon-lg { width: 1.75rem; height: 1.75rem; }
.icon-xl { width: 2.25rem; height: 2.25rem; }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: transform .25s ease, background .25s ease;
}
.icon-badge-sm { width: 44px; height: 44px; }
.icon-badge-sm .icon { width: 22px; height: 22px; }
.icon-badge-md { width: 72px; height: 72px; }
.icon-badge-md .icon { width: 34px; height: 34px; }
.icon-badge-lg { width: 96px; height: 96px; }
.icon-badge-lg .icon { width: 46px; height: 46px; }
.icon-badge-xl { width: 120px; height: 120px; }
.icon-badge-xl .icon { width: 56px; height: 56px; }

.icon-badge-solid {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 1000;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}
.brand:hover { text-decoration: none; color: var(--color-text); }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.brand-name { line-height: 1.15; }
.brand-name small {
  display: block;
  font-size: .7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: .01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  padding: 0;
}
.theme-toggle:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Navigation ---------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav { margin-left: auto; }
.site-nav > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.site-nav > ul > li { margin: 0; }
.site-nav a {
  display: block;
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 500;
  font-size: .95rem;
  transition: background .2s ease, color .2s ease;
}
.site-nav a:hover { background: var(--color-bg-alt); text-decoration: none; color: var(--color-primary); }
.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.site-nav .has-sub { position: relative; }
.site-nav .has-sub > a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.site-nav .has-sub > a::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .55;
  transition: transform .2s ease, opacity .2s ease;
}
.site-nav .has-sub:hover > a::after,
.site-nav .has-sub:focus-within > a::after,
.site-nav .has-sub.open > a::after {
  transform: rotate(180deg);
  opacity: .9;
}
/* Mobile-only disclosure button — hidden on desktop; hover handles submenu there. */
.site-nav .submenu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: inherit;
  padding: .5rem .8rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.site-nav .submenu-toggle .icon {
  width: 18px;
  height: 18px;
  transition: transform .2s ease;
}
.site-nav .has-sub.open > .submenu-toggle .icon {
  transform: rotate(180deg);
}
.site-nav .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
/* Invisible hover bridge so the pointer can cross from parent link to
   submenu without losing :hover and collapsing the menu. */
.site-nav .has-sub::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: .5rem;
}
.site-nav .has-sub:hover > .submenu,
.site-nav .has-sub:focus-within > .submenu,
.site-nav .has-sub.open > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(.5rem);
}
.site-nav .submenu li { margin: 0; }
.site-nav .submenu a {
  display: block;
  padding: .55rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
}
.site-nav .submenu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding-left: 1rem;
}
.site-nav .submenu a[aria-current="page"] {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    box-shadow: var(--shadow-md);
  }
  .site-nav[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav > ul { flex-direction: column; align-items: stretch; padding: .5rem; gap: 0; }
  .site-nav .has-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .site-nav .has-sub > a {
    flex: 1;
    min-width: 0;
  }
  /* Hide the ::after arrow on the link on mobile — the disclosure button owns it. */
  .site-nav .has-sub > a::after { display: none; }
  .site-nav .submenu-toggle { display: inline-flex; }
  .site-nav .has-sub > .submenu { flex-basis: 100%; }
  .site-nav .has-sub::after { display: none; }
  .site-nav .submenu {
    position: static;
    border: 0;
    box-shadow: none;
    padding: .25rem 0 .25rem 1rem;
    background: transparent;
    margin: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .site-nav .has-sub.open > .submenu { display: flex; }
  .site-nav .has-sub:hover > .submenu,
  .site-nav .has-sub:focus-within > .submenu { transform: none; }
  .site-nav .submenu a:hover { padding-left: .8rem; }
  .site-nav a { padding: .8rem 1rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3.5rem, 7vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4.5rem);
  background: var(--color-bg);
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .25;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 65%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }

/* Animated decorative layer */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  will-change: transform;
}
.hero-blob-1 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(217,45,32,.55), rgba(217,45,32,0) 70%);
  top: -120px; right: -100px;
  animation: blob-drift-a 18s ease-in-out infinite;
}
.hero-blob-2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(251,113,133,.45), rgba(251,113,133,0) 70%);
  bottom: -140px; left: -80px;
  animation: blob-drift-b 22s ease-in-out infinite;
}
:root[data-theme="dark"] .hero-blob-1 {
  background: radial-gradient(circle, rgba(251,113,133,.35), rgba(251,113,133,0) 70%);
}
:root[data-theme="dark"] .hero-blob-2 {
  background: radial-gradient(circle, rgba(244,63,94,.3), rgba(244,63,94,0) 70%);
}
@keyframes blob-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.08); }
}
@keyframes blob-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -25px) scale(.95); }
}

/* ECG heartbeat line — medically staged: VFib -> post-shock pause -> Sinus rhythm.
 * Total cycle 12s: 0-35% VFib visible, 35-50% transition (flatline = post-shock
 * pause), 50-92% NSR visible, 92-100% fade back. A travelling stroke-dashoffset
 * highlight rides along the NSR only (VFib has no organised wavefront). */
.hero-ecg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 110px;
  pointer-events: none;
  color: var(--color-primary);
}
.hero-ecg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.hero-ecg .ecg-paper {
  pointer-events: none;
}
.hero-ecg .ecg-flatline {
  stroke: currentColor;
  stroke-width: 1.2;
  opacity: .15;
}
.hero-ecg .ecg-trace {
  stroke: currentColor;
  stroke-width: 2.1;
  opacity: 0;
  filter: drop-shadow(0 0 2.5px color-mix(in srgb, var(--color-primary) 55%, transparent));
}
.hero-ecg .ecg-vfib {
  animation: ecg-rhythm-vfib 12s ease-in-out infinite;
}
.hero-ecg .ecg-nsr {
  animation: ecg-rhythm-nsr 12s ease-in-out infinite;
}
.hero-ecg .ecg-pulse {
  stroke: currentColor;
  stroke-width: 2.8;
  fill: none;
  stroke-dasharray: 110 1090;
  stroke-dashoffset: 1200;
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--color-primary) 90%, transparent));
  opacity: 0;
  animation: ecg-rhythm-nsr 12s ease-in-out infinite,
             ecg-travel 5s linear infinite;
}
.hero-ecg .ecg-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  fill: var(--color-primary);
  opacity: 0;
}
.hero-ecg .ecg-label-vfib { animation: ecg-rhythm-vfib 12s ease-in-out infinite; }
.hero-ecg .ecg-label-nsr { animation: ecg-rhythm-nsr 12s ease-in-out infinite; }

@keyframes ecg-rhythm-vfib {
  0%, 35% { opacity: .55; }
  42%, 92% { opacity: 0; }
  100% { opacity: .55; }
}
@keyframes ecg-rhythm-nsr {
  0%, 50% { opacity: 0; }
  57%, 92% { opacity: .9; }
  100% { opacity: 0; }
}
@keyframes ecg-travel {
  from { stroke-dashoffset: 1200; }
  to { stroke-dashoffset: 0; }
}

.hero .tagline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .95rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  animation: pulse-dot 2s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 70%, transparent); }
  70% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--color-primary) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 0%, transparent); }
}

.hero h1 { margin-bottom: .7rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.hero .lead {
  font-size: clamp(1.05rem, .95rem + .4vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0 auto 1.8rem;
}
.hero-actions {
  display: flex;
  gap: .8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Hero stats strip ---------- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 2rem;
  justify-items: center;
  margin: 3rem auto 0;
  padding-top: 2.4rem;
  max-width: 760px;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
}
.hero-stat {
  text-align: center;
  min-width: 120px;
}
.hero-stat strong {
  display: block;
  font-size: clamp(1.75rem, 1.3rem + 1.3vw, 2.25rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--color-primary);
  letter-spacing: -.025em;
  line-height: 1.05;
  margin-bottom: .35rem;
  font-feature-settings: "tnum";
}
.hero-stat span {
  display: block;
  font-size: .78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  line-height: 1.35;
}

/* Staggered entrance */
.hero-animated .tagline,
.hero-animated h1,
.hero-animated .lead,
.hero-animated .hero-actions,
.hero-animated .hero-stats {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-rise .7s cubic-bezier(.22,1,.36,1) forwards;
}
.hero-animated .tagline     { animation-delay: .05s; }
.hero-animated h1           { animation-delay: .18s; }
.hero-animated .lead        { animation-delay: .32s; }
.hero-animated .hero-actions{ animation-delay: .46s; }
.hero-animated .hero-stats  { animation-delay: .6s; }
@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* Subtle glow pulse on primary CTA */
.hero-actions .btn-primary {
  box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--color-primary) 70%, transparent), var(--shadow-sm);
}

/* Reveal-on-scroll (set by JS observer) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-animated .tagline,
  .hero-animated h1,
  .hero-animated .lead,
  .hero-animated .hero-actions,
  .hero-animated .hero-stats {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hero-blob, .pulse-dot,
  .ecg-vfib, .ecg-nsr, .ecg-pulse,
  .ecg-label-vfib, .ecg-label-nsr { animation: none !important; }
  .ecg-vfib, .ecg-label-vfib { opacity: 0; }
  .ecg-nsr, .ecg-label-nsr { opacity: .9; }
  .ecg-pulse { opacity: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:focus-visible { outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--color-primary) 60%, transparent), var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, #fff 15%, transparent), transparent 50%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--color-primary) 75%, transparent), var(--shadow-md);
}
.btn-primary:hover::after { opacity: 1; }
.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-outline:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Main ---------- */
main { flex: 1; }
.section { padding: clamp(2.75rem, 5vw, 5rem) 0; position: relative; }
.section-alt {
  background: var(--color-bg-alt);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.section-alt::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--color-text-subtle) 30%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black, transparent 85%);
  z-index: -1;
  pointer-events: none;
}
.section-title {
  text-align: center;
  margin-bottom: 2.75rem;
}
.section-title h2 { margin-bottom: .6rem; }
.section-title p { color: var(--color-text-muted); max-width: 620px; margin: 0 auto; }
.section-title .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--color-primary);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .75rem;
  padding: .35rem .9rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.section-title .eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* ---------- CPR three-step grid ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem 1.5rem;
  padding-top: 1.5rem;
}
.step {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 4.4rem 1.6rem 1.9rem;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, border-color .25s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, var(--color-primary-light), transparent 55%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: -1;
}
.step:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.step:hover::before { opacity: 1; }
.step:hover .icon-badge { transform: scale(1.08); }
.step .step-num {
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 6px 18px -4px color-mix(in srgb, var(--color-primary) 55%, transparent);
  letter-spacing: -.02em;
  z-index: 2;
}
.step .icon-badge { margin: 0 auto 1.15rem; transition: transform .3s cubic-bezier(.22,1,.36,1), background .25s ease; }
.step h3 { color: var(--color-text); margin-bottom: .55rem; }
.step p, .step ul { text-align: left; color: var(--color-text-muted); }
.step p { margin-bottom: 0; }

/* ---------- Card grid (disaster hub, info portal) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.9rem 1.2rem 1.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 600;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, border-color .25s ease;
  min-height: 210px;
  gap: .9rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--color-primary-light), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  z-index: -1;
}
.card::before {
  content: "→";
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: translate(-4px, 2px);
  transition: opacity .25s ease, transform .25s cubic-bezier(.22,1,.36,1), background .25s ease, color .25s ease;
  z-index: 2;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
  color: var(--color-text);
}
.card:hover::after { opacity: 1; }
.card:hover::before {
  opacity: 1;
  transform: translate(0, 0);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--color-primary) 55%, transparent);
}
.card:hover .icon-badge { background: var(--color-primary); color: #fff; transform: scale(1.06); }
.card .icon-badge { transition: background .25s ease, color .25s ease, transform .3s cubic-bezier(.22,1,.36,1); }
.card-label { font-size: .95rem; letter-spacing: .01em; line-height: 1.35; position: relative; z-index: 1; }

/* ---------- BLS detailed rows ---------- */
.bls-table {
  display: grid;
  gap: 1.1rem;
  counter-reset: bls-row;
  position: relative;
}
.bls-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem 1.75rem 1.75rem 2.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: transform .25s cubic-bezier(.22,1,.36,1), border-color .2s ease, box-shadow .25s ease;
  counter-increment: bls-row;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.bls-row::before {
  content: counter(bls-row, decimal-leading-zero);
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--color-primary);
  opacity: .35;
  font-feature-settings: "tnum";
  transition: opacity .25s ease, transform .25s ease;
}
.bls-row::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
  opacity: .5;
  transition: opacity .25s ease, width .25s ease;
}
.bls-row:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-border));
  box-shadow: var(--shadow-md);
}
.bls-row:hover::before { opacity: .75; transform: translateY(-2px); }
.bls-row:hover::after { opacity: 1; width: 4px; }
.bls-row .bls-icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: .2rem;
}
.bls-row:hover .icon-badge { background: var(--color-primary); color: #fff; }
.bls-row .icon-badge { transition: background .25s ease, color .25s ease; }
.bls-row h3 {
  margin-top: 0;
  color: var(--color-text);
}
@media (max-width: 720px) {
  .bls-row { grid-template-columns: 1fr; text-align: left; gap: 1rem; padding: 1.4rem 1.2rem 1.4rem 1.7rem; }
  .bls-row .bls-icon { justify-content: flex-start; }
  .bls-row::before { top: .9rem; right: 1rem; }
}

/* ---------- Algorithm flow ---------- */
.algo-flow {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .9rem;
  counter-reset: algo-step;
  position: relative;
  padding-left: 26px;
}
.algo-flow::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--color-primary) 35%, transparent) 8%,
    color-mix(in srgb, var(--color-primary) 35%, transparent) 92%,
    transparent 100%);
  z-index: 0;
}
.algo-step {
  width: 100%;
  padding: 1.1rem 1.35rem 1.1rem 3rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: left;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  position: relative;
  counter-increment: algo-step;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s ease, border-color .25s ease;
  z-index: 1;
}
.algo-step::before {
  content: counter(algo-step);
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.algo-step:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
}
.algo-step:hover::before {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  transform: translateY(-50%) scale(1.06);
}
.algo-step:first-child,
.algo-step:last-child {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-color: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--color-primary) 55%, transparent);
}
.algo-step:first-child::before,
.algo-step:last-child::before {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
}
.algo-arrow { display: none; }

/* ---------- Principles ---------- */
.principles {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.principle {
  padding: 1.75rem 1.6rem 1.65rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, border-color .25s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.principle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
  transition: width .3s cubic-bezier(.22,1,.36,1);
  z-index: -1;
}
.principle::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--color-primary-light), transparent 70%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: -1;
}
.principle:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-border));
}
.principle:hover::before { width: 6px; }
.principle:hover::after { opacity: 1; }
.principle h3 {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .6rem;
  padding-left: .6rem;
}
.principle p { padding-left: .6rem; margin-bottom: 0; color: var(--color-text-muted); }
.principle .num {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--color-primary) 50%, transparent);
  flex-shrink: 0;
}

/* ---------- Article layout ---------- */
.article {
  max-width: 780px;
  margin: 0 auto;
}
.article > p:first-of-type:not(.lead) { font-size: 1.1rem; color: var(--color-text-muted); }
.article h2 {
  margin-top: 3rem;
  padding-bottom: .5rem;
  position: relative;
  display: inline-block;
}
.article h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) 40%, color-mix(in srgb, var(--color-primary) 30%, transparent) 70%, transparent 100%);
}
.article h3 {
  margin-top: 2rem;
  color: var(--color-text);
  padding-left: .85rem;
  position: relative;
}
.article h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: .28em;
  bottom: .28em;
  width: 3px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--color-primary) 55%, transparent);
}

.article figure {
  margin: 2rem 0;
}
.article figure img,
.article > img,
.article figure figcaption { display: block; }

.article figure img,
.article > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.article figcaption {
  text-align: center;
  font-size: .88rem;
  color: var(--color-text-subtle);
  margin-top: .6rem;
}
.article ul, .article ol { padding-left: 1.4rem; }
.article ul li, .article ol li { padding-left: .15rem; }

/* Stylised ordered list inside articles: custom red circle counters */
.article ol {
  list-style: none;
  padding-left: 0;
  counter-reset: article-ol;
}
.article ol > li {
  counter-increment: article-ol;
  position: relative;
  padding: .15rem 0 .15rem 3.1rem;
  margin-bottom: .85rem;
  min-height: 2.1rem;
}
.article ol > li::before {
  content: counter(article-ol);
  position: absolute;
  left: 0;
  top: .1rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--color-primary) 55%, transparent);
  font-feature-settings: "tnum";
  letter-spacing: -.02em;
}
.article ol > li > ul,
.article ol > li > ol {
  margin-top: .45rem;
}
.article ol > li > ol { counter-reset: article-ol-inner; }
.article ol > li > ol > li { counter-increment: article-ol-inner; }
.article ol > li > ol > li::before {
  content: counter(article-ol-inner, lower-alpha);
  background: var(--color-bg);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  width: 1.75rem;
  height: 1.75rem;
  font-size: .8rem;
  box-shadow: none;
}

.article blockquote {
  margin: 2rem 0;
  padding: 1.75rem 1.75rem 1.5rem 3.5rem;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--color-primary) 6%, transparent), transparent 60%),
    var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.article blockquote::before {
  content: "\201C";
  position: absolute;
  top: -.35rem;
  left: .85rem;
  font-size: 4rem;
  line-height: 1;
  color: color-mix(in srgb, var(--color-primary) 35%, transparent);
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
  pointer-events: none;
}

.callout {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-warning-bg);
  border: 1px solid color-mix(in srgb, var(--color-warning-border) 30%, transparent);
  border-left: 4px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  color: var(--color-warning-text);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.callout::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, color-mix(in srgb, var(--color-warning-border) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.callout strong { color: var(--color-warning-text); }
.callout-danger {
  background: var(--color-primary-light);
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-left-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.callout-danger::after {
  background: radial-gradient(circle, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 70%);
}
.callout-danger strong { color: var(--color-primary-dark); }
:root[data-theme="dark"] .callout-danger { color: #fecaca; }
:root[data-theme="dark"] .callout-danger strong { color: #fecaca; }

/* ---------- Ad slot ---------- */
.ad-slot {
  margin: 2.5rem auto;
  max-width: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text-subtle);
  font-size: .82rem;
  background: var(--color-bg-alt);
}
.ad-slot:empty::before { content: "Реклама"; opacity: .6; }

/* ---------- Footer (light-theme friendly) ---------- */
.site-footer {
  margin-top: auto;
  background:
    radial-gradient(ellipse 60% 100% at 90% 0%, color-mix(in srgb, var(--color-primary) 5%, transparent), transparent 55%),
    var(--color-bg-alt);
  color: var(--color-text-muted);
  padding: 3.5rem 0 1.5rem;
  border-top: 1px solid var(--color-border);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--color-primary) 45%, transparent) 30%, color-mix(in srgb, var(--color-primary) 45%, transparent) 70%, transparent 100%);
}
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-primary); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-grid h4 {
  color: var(--color-text);
  font-size: .78rem;
  margin-bottom: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  position: relative;
  padding-bottom: .6rem;
}
.footer-grid h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 20%, transparent));
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li {
  margin-bottom: .45rem;
  position: relative;
}
.footer-grid li::marker { color: transparent; }
.footer-grid ul a,
.footer-grid ul .cookie-link-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
  transition: color .2s ease, transform .2s ease;
  line-height: 1.4;
}
.footer-grid ul a::before,
.footer-grid ul .cookie-link-btn::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s ease, transform .2s ease;
  flex-shrink: 0;
}
.footer-grid ul a:hover::before,
.footer-grid ul .cookie-link-btn:hover::before {
  opacity: 1;
  transform: scale(1);
}
.footer-grid ul a:hover,
.footer-grid ul .cookie-link-btn:hover {
  color: var(--color-primary);
  text-decoration: none;
}
.footer-grid ul .cookie-link-btn { text-decoration: none; }
.footer-brand { display: inline-flex; align-items: center; gap: .7rem; margin-bottom: 1rem; text-decoration: none; color: inherit; }
.footer-brand:hover .brand-name { color: var(--color-primary); }
.footer-brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--color-primary) 40%, transparent);
}
.footer-brand .brand-name { color: var(--color-text); font-weight: 700; letter-spacing: -.01em; }
.footer-brand .brand-name small { color: var(--color-text-muted); }
.footer-tagline {
  color: var(--color-text-muted);
  font-size: .92rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  max-width: 26ch;
}
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.footer-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--color-text-subtle);
}
.footer-bottom .heart {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--color-text-muted);
}
.footer-bottom .heart svg {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
  animation: heart-beat 2.4s ease-in-out infinite;
}
@keyframes heart-beat {
  0%, 50%, 100% { transform: scale(1); }
  20%, 70% { transform: scale(1.15); }
  25%, 75% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .footer-bottom .heart svg { animation: none; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: .85rem;
  color: var(--color-text-subtle);
  margin-bottom: 1.1rem;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem;
  padding: .35rem .85rem .35rem .7rem;
  background: color-mix(in srgb, var(--color-bg-alt) 70%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.breadcrumbs a {
  color: var(--color-text-muted);
  padding: .1rem .45rem;
  border-radius: var(--radius-full);
  transition: color .2s ease, background .2s ease;
  font-weight: 500;
}
.breadcrumbs a:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
  text-decoration: none;
}
.breadcrumbs > span:last-child {
  color: var(--color-text);
  font-weight: 600;
  padding: .1rem .45rem;
}
.breadcrumbs .sep {
  width: .9rem;
  height: .9rem;
  opacity: .55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-subtle);
  flex-shrink: 0;
}
.breadcrumbs .sep::before {
  content: "";
  width: 5px;
  height: 5px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  display: inline-block;
}

/* ---------- Page header block ---------- */
.page-header {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 2.5vw, 2.2rem);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 100% at 15% 0%, color-mix(in srgb, var(--color-primary) 14%, transparent), transparent 55%),
    radial-gradient(ellipse 55% 90% at 90% 100%, color-mix(in srgb, var(--color-primary) 9%, transparent), transparent 60%);
  z-index: -2;
  pointer-events: none;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .32;
  mask-image: linear-gradient(180deg, black 0%, transparent 90%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 90%);
  z-index: -1;
  pointer-events: none;
}
.page-header > .container { position: relative; z-index: 1; }
.page-header h1 { margin-bottom: .5rem; }
.page-header .lead {
  color: var(--color-text-muted);
  max-width: 720px;
  margin: .5rem 0 0;
}

/* ---------- 404 page ---------- */
.err-hero {
  position: relative;
  text-align: center;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--color-border);
}
.err-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, color-mix(in srgb, var(--color-primary) 12%, transparent), transparent 65%);
  z-index: -2;
  pointer-events: none;
}
.err-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .28;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 75%);
  z-index: -1;
  pointer-events: none;
}
.err-code {
  display: inline-block;
  font-size: clamp(6rem, 18vw, 12rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.06em;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--color-primary);
  margin-bottom: 1rem;
  text-shadow: 0 30px 60px color-mix(in srgb, var(--color-primary) 20%, transparent);
  font-feature-settings: "tnum";
}
.err-code span {
  display: inline-block;
  transform-origin: center;
}
.err-code span:nth-child(2) {
  animation: err-bob 3s ease-in-out infinite;
  position: relative;
}
@keyframes err-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
.err-hero h1 {
  margin-bottom: .75rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.err-hero .lead {
  max-width: 560px;
  margin: 0 auto 1.8rem;
  color: var(--color-text-muted);
}
@media (prefers-reduced-motion: reduce) {
  .err-code span:nth-child(2) { animation: none; }
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 20px);
  width: min(680px, calc(100% - 2rem));
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px color-mix(in srgb, var(--color-primary) 22%, transparent),
              0 12px 32px -12px rgba(0, 0, 0, .18);
  padding: 1.5rem 1.6rem 1.35rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform .38s cubic-bezier(.22,1,.36,1),
              opacity .35s ease,
              visibility .35s;
  overflow: hidden;
  isolation: isolate;
}
.cookie-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  z-index: 1;
}
.cookie-banner::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--color-primary-light), transparent 70%);
  opacity: .6;
  pointer-events: none;
  z-index: -1;
}
.cookie-banner[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translate(-50%, 0);
}
.cookie-banner-body {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}
.cookie-banner-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--color-primary) 55%, transparent);
}
.cookie-banner-icon svg { width: 26px; height: 26px; }
.cookie-banner-text { flex: 1; min-width: 0; }
.cookie-banner h3 {
  margin: 0 0 .35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.01em;
}
.cookie-banner p {
  margin: 0 0 .75rem;
  font-size: .92rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}
.cookie-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.cookie-features li {
  font-size: .85rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  padding-left: 1.1rem;
  position: relative;
}
.cookie-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: .7;
}
.cookie-features strong { color: var(--color-text); font-weight: 600; }
.cookie-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.cookie-actions .btn {
  flex: 1 1 auto;
  min-width: 140px;
  padding: .7rem 1.2rem;
  font-size: .92rem;
  font-weight: 600;
  justify-content: center;
}
.cookie-link-btn {
  background: transparent;
  border: 0;
  color: var(--color-primary);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

@media (max-width: 540px) {
  .cookie-banner {
    bottom: .75rem;
    padding: 1.25rem 1.15rem 1.1rem;
    gap: 1rem;
  }
  .cookie-banner-body { gap: .85rem; }
  .cookie-banner-icon { width: 42px; height: 42px; border-radius: 12px; }
  .cookie-banner-icon svg { width: 22px; height: 22px; }
  .cookie-banner h3 { font-size: 1rem; }
  .cookie-banner p { font-size: .88rem; }
  .cookie-features li { font-size: .82rem; }
  .cookie-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: opacity .2s ease, visibility .2s; transform: translateX(-50%); }
  .cookie-banner[data-open="true"] { transform: translateX(-50%); }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Spacing utilities ----------
   Replace inline style= attributes in generated pages so CSP can forbid
   inline styles (style-src without 'unsafe-inline'). */
.mt-sm { margin-top: .5rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; }
.my-2 { margin: 2rem 0; }
.menu-sublabel { font-weight: 400; font-size: .85rem; color: var(--color-text-muted); }
.muted-note { color: var(--color-text-muted); }
.muted-note-sm { color: var(--color-text-muted); font-size: .9rem; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .cookie-banner, .ad-slot, .nav-toggle, .theme-toggle { display: none !important; }
  a::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .hero, .page-header { background: #fff; }
}
