/* ==========================================================================
   Kuenrix — Core Stylesheet
   Modern SaaS. Premium. Minimal. Black, white, subtle blue.
   No frameworks, no build step — plain CSS3, mobile-first.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Neutrals */
  --ink: #0b0f19;
  --ink-soft: #1c2433;
  --slate: #5b6472;
  --slate-soft: #8a93a3;
  --mist: #f6f8fb;
  --mist-strong: #eef1f6;
  --line: #e4e9f1;
  --paper: #ffffff;

  /* Brand blue */
  --blue-700: #23417a;
  --blue-600: #2f57a0;
  --blue-500: #3f6fc4;
  --blue-100: #eaf0fb;
  --blue-50: #f5f8fe;

  /* Semantic */
  --success: #1f7a4d;
  --success-bg: #e7f6ee;
  --warning: #93650a;
  --warning-bg: #fbf1da;
  --danger: #b3261e;
  --danger-bg: #fbeaea;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing scale (8px base) */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2rem;
  --sp-6: 3rem;
  --sp-7: 4rem;
  --sp-8: 6rem;
  --sp-9: 8rem;

  /* Radius scale */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11, 15, 25, 0.04), 0 1px 1px rgba(11, 15, 25, 0.03);
  --shadow-md: 0 8px 24px rgba(11, 15, 25, 0.08);
  --shadow-lg: 0 24px 64px rgba(11, 15, 25, 0.14);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 260ms;
  --dur-slow: 500ms;

  --container: 1180px;
  --container-narrow: 760px;
}

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

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

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

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ---------- Focus visibility (accessibility, non-negotiable) ---------- */
:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typography scale ---------- */
h1,
.h1 {
  font-size: clamp(2.1rem, 5vw + 1rem, 3.6rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2,
.h2 {
  font-size: clamp(1.7rem, 3vw + 1rem, 2.5rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h3,
.h3 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.lede {
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.25rem);
  color: var(--slate);
  line-height: 1.6;
  max-width: 62ch;
}

p {
  color: var(--slate);
}

.text-ink {
  color: var(--ink);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: -0.01em;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.section {
  padding-block: var(--sp-8);
}

.section-tight {
  padding-block: var(--sp-6);
}

.section-alt {
  background: var(--mist);
}

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

.section-dark p,
.section-dark .lede {
  color: rgba(255, 255, 255, 0.72);
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
  align-items: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: 0.9rem 1.6rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: var(--blue-700);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.btn-inverse {
  background: var(--paper);
  color: var(--ink);
}

.btn-inverse:hover {
  background: var(--blue-100);
}

.btn-ghost {
  padding: 0.5rem 0;
  color: var(--blue-600);
  font-weight: 600;
}

.btn-ghost::after {
  content: "→";
  margin-left: 0.4rem;
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease);
}

.btn-ghost:hover::after {
  transform: translateX(3px);
}

.btn-block {
  width: 100%;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--sp-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--blue-600);
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--sp-6);
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--slate);
  transition: color var(--dur-fast) var(--ease);
  position: relative;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--blue-600);
  border-radius: 2px;
}

.nav-actions {
  display: none;
  align-items: center;
  gap: var(--sp-3);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
}

.nav-toggle:hover {
  background: var(--mist-strong);
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  width: 20px;
  height: 2px;
  background: var(--ink);
  display: block;
  position: relative;
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-open .nav-toggle-icon {
  background: transparent;
}

.nav-open .nav-toggle-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: var(--sp-4) 0 var(--sp-5);
}

.nav-open .mobile-panel {
  display: block;
}

.mobile-panel .nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: flex-start;
}

.mobile-panel .nav-actions {
  display: flex;
  margin-top: var(--sp-4);
  width: 100%;
}

.mobile-panel .btn {
  width: 100%;
}

@media (min-width: 860px) {
  .nav-links {
    display: flex;
  }
  .nav-actions {
    display: flex;
  }
  .nav-toggle {
    display: none;
  }
  .mobile-panel {
    display: none !important;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--sp-7) var(--sp-8);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: var(--sp-7);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--slate-soft);
  font-size: 0.85rem;
  margin-top: var(--sp-2);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mark-canvas {
  width: min(420px, 100%);
  height: auto;
  color: var(--blue-600);
}

.mark-node {
  transform-origin: center;
}

.mark-path {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: draw 1.6s var(--ease) forwards 0.2s;
}

.mark-shape {
  opacity: 0;
  animation: rise var(--dur-slow) var(--ease) forwards;
}

.mark-shape:nth-of-type(1) {
  animation-delay: 0.5s;
}
.mark-shape:nth-of-type(2) {
  animation-delay: 0.7s;
}
.mark-shape:nth-of-type(3) {
  animation-delay: 0.9s;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mark-path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .mark-shape {
    animation: none;
    opacity: 1;
  }
}

@media (min-width: 940px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease);
}

.card-hover:hover {
  border-color: var(--blue-100);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--blue-100);
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.grid-4 {
  grid-template-columns: 1fr;
}

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

@media (min-width: 940px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Badge / Tag ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge-live {
  background: var(--success-bg);
  color: var(--success);
}

.badge-soon {
  background: var(--mist-strong);
  color: var(--slate);
}

/* ---------- Product cards ---------- */
.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.product-card ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.check-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--blue-600);
}

/* ---------- Feature list (Why Kuenrix) ---------- */
.feature {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* ---------- Divider note / callout ---------- */
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-600);
  background: var(--blue-50);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.callout-title {
  font-weight: 650;
  color: var(--ink);
  font-size: 0.95rem;
}

.callout p {
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-7) var(--sp-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.cta-band .lede {
  color: rgba(255, 255, 255, 0.72);
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--sp-7) var(--sp-5);
}

.footer-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 26rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-soft);
  margin-bottom: var(--sp-3);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer-col a {
  color: var(--slate);
  font-size: 0.95rem;
  transition: color var(--dur-fast) var(--ease);
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  margin-top: var(--sp-7);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: center;
  color: var(--slate-soft);
  font-size: 0.85rem;
}

@media (min-width: 780px) {
  .footer-grid {
    grid-template-columns: 1.2fr 2fr;
  }
  .footer-cols {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Page hero (secondary pages) ---------- */
.page-hero {
  padding-block: var(--sp-7) var(--sp-6);
  border-bottom: 1px solid var(--line);
}

.page-hero .lede {
  margin-top: var(--sp-3);
}

/* ---------- Reveal-on-scroll (progressive enhancement) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Stat row ---------- */
.stat-row {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-label {
  color: var(--slate);
  font-size: 0.9rem;
}

@media (min-width: 640px) {
  .stat-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Form (contact page) ---------- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.form-field .hint {
  font-size: 0.8rem;
  color: var(--slate-soft);
}

.form-field input,
.form-field textarea,
.form-field select {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.85rem 1rem;
  background: var(--paper);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-100);
  outline: none;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .form-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.form-status {
  display: none;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  background: var(--success-bg);
  color: var(--success);
}

.form-status.is-visible {
  display: block;
}

/* ---------- Contact info list ---------- */
.info-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.info-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.info-item .card-icon {
  margin-bottom: 0;
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.center-text { text-align: center; }
.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 {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) 0;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}
