/* ============================================================
   klukvaCloud — Base / Reset / Layout primitives
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
  overflow-x: hidden;
}

img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* ---- Typography primitives ---- */
h1, h2, h3, h4 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
  text-wrap: balance;
}

.display {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-optical-sizing: auto;
}

p { text-wrap: pretty; }

.eyebrow {
  display: none !important;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-brand);
}

.lede {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow { max-width: var(--container-narrow); }
.container.wide { max-width: var(--container-wide); }

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section.tight { padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.section.subtle { background: var(--bg-subtle); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid { display: grid; gap: var(--sp-6); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.wrap { flex-wrap: wrap; }

.divider { height: 1px; background: var(--border); border: 0; }

/* Section heading block */
.section-head {
  max-width: 44rem;
  margin-bottom: var(--sp-6);
}
.section-head.center { margin-inline: 0; text-align: left; max-width: 60ch; }
.section-head h2 {
  font-size: var(--fs-2xl);
  margin-top: var(--sp-3);
}
.section-head p { margin-top: var(--sp-3); }

/* Utility: visually hidden but accessible */
.visually-hidden {
  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 */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: var(--z-toast);
  background: var(--brand-600);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--sp-4); }

/* Prevent flash: hide until i18n applied when requested */
[data-i18n-cloak] { visibility: hidden; }

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* No-JS fallback */
.no-js .reveal { opacity: 1; transform: none; }
