/* KarbonMetrik marketing site — global styles, responsive, dark mode */

:root {
  --site-max: 1240px;
  --site-pad: 24px;
  --header-h: 72px;

  /* Light theme (default — uses tokens from ../../colors_and_type.css) */
  --bg:           var(--km-paper);
  --bg-elevated:  #fff;
  --bg-muted:     var(--km-stone-50);
  --bg-inverse:   var(--km-slate);
  --fg:           var(--km-fg-1);
  --fg-2:         var(--km-fg-2);
  --fg-3:         var(--km-fg-3);
  --fg-4:         var(--km-fg-4);
  --fg-on-dark:   #f6f7f5;
  --border:       var(--km-border);
  --border-strong:var(--km-border-strong);
  --divider:      var(--km-divider);
  --accent:       var(--km-green);
  --accent-deep:  var(--km-forest);
  --accent-soft:  var(--km-mint);
  --accent-soft-strong: var(--km-mint-strong);
  --shadow-1:     var(--km-shadow-1);
  --shadow-2:     var(--km-shadow-2);
  --shadow-3:     var(--km-shadow-3);
}

[data-theme="dark"] {
  --bg:           #0E1612;
  --bg-elevated:  #16221C;
  --bg-muted:     #1B2A22;
  --bg-inverse:   #0A0F0C;
  --fg:           #F0F5F1;
  --fg-2:         #C9D4CC;
  --fg-3:         #8FA095;
  --fg-4:         #6A7A6F;
  --border:       #243329;
  --border-strong:#324435;
  --divider:      #1E2C24;
  --accent:       #2BC371;
  --accent-deep:  #61E29B;
  --accent-soft:  #163024;
  --accent-soft-strong: #1F4231;
  --shadow-1:     0 1px 2px rgba(0,0,0,.4);
  --shadow-2:     0 6px 16px rgba(0,0,0,.5);
  --shadow-3:     0 18px 40px rgba(0,0,0,.6);
}

/* Reset-ish */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--km-font-sans);
  font-feature-settings: "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms cubic-bezier(.2,.8,.2,1), color 200ms cubic-bezier(.2,.8,.2,1);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* Layout helpers */
.container {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--site-pad);
  width: 100%;
}
.section {
  padding: 96px 0;
}
.section--tight { padding: 64px 0; }
.section--xl { padding: 120px 0; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  margin-bottom: 14px;
}
[data-theme="dark"] .eyebrow { color: var(--accent-deep); }

h1, h2, h3, h4 { letter-spacing: -0.02em; margin: 0; color: var(--fg); }
h1 { font-size: clamp(40px, 5.6vw, 64px); font-weight: 800; line-height: 1.05; }
h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.15; }
h3 { font-size: clamp(20px, 2.2vw, 24px); font-weight: 700; line-height: 1.25; }
h4 { font-size: 16px; font-weight: 700; line-height: 1.3; }
p { color: var(--fg-2); line-height: 1.6; margin: 0; text-wrap: pretty; }

.lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--fg-2); line-height: 1.55; max-width: 60ch; }
.mono { font-family: var(--km-font-mono); font-variant-numeric: tabular-nums; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 140ms cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn--secondary {
  background: var(--bg-elevated);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--bg-muted); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: transparent;
}
.btn--ghost:hover { background: var(--bg-muted); }
.btn--lg { padding: 14px 24px; font-size: 15px; }
.btn--sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}
.card--lift { transition: transform 200ms, box-shadow 200ms; }
.card--lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid var(--accent-soft-strong);
}
[data-theme="dark"] .pill { color: var(--accent-deep); }
.pill__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h);
}
.site-header__logo { display: flex; align-items: center; gap: 8px; }
.site-header__logo img { height: 26px; width: auto; }
.site-header__nav { display: flex; align-items: center; gap: 4px; flex: 1; margin-left: 12px; }
.site-header__nav a {
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--fg-2);
  cursor: pointer;
}
.site-header__nav a:hover { background: var(--bg-muted); color: var(--fg); }
.site-header__nav a.is-active { color: var(--fg); font-weight: 600; }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--fg); }
.lang-toggle {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-muted); border-radius: 8px;
  border: 1px solid var(--border);
}
.lang-toggle button {
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; border: none; cursor: pointer;
  background: transparent; color: var(--fg-3);
}
.lang-toggle button.is-active { background: var(--bg-elevated); color: var(--fg); box-shadow: var(--shadow-1); }

/* Mobile nav */
.menu-toggle { display: none; }
@media (max-width: 980px) {
  .site-header__nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-header__actions .lang-toggle,
  .site-header__actions .btn--secondary { display: none; }
  .mobile-drawer { display: block; }
}
.mobile-drawer {
  display: none; position: fixed; inset: var(--header-h) 0 0 0;
  background: var(--bg); z-index: 40;
  padding: 24px;
  flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border);
}
.mobile-drawer.is-open { display: flex; }
.mobile-drawer a {
  display: block; padding: 14px; border-radius: 8px;
  font-size: 17px; font-weight: 600; color: var(--fg-2);
  border-bottom: 1px solid var(--divider);
}
.mobile-drawer a.is-active { color: var(--fg); }

/* Footer */
.site-footer {
  background: var(--bg-inverse);
  color: var(--fg-on-dark);
  padding: 80px 0 32px;
  margin-top: 0;
}
.site-footer .container { color: inherit; }
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.site-footer__cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.site-footer a {
  display: block; padding: 6px 0;
  font-size: 14px; color: rgba(255,255,255,.65);
  cursor: pointer; transition: color 140ms;
}
.site-footer a:hover { color: #fff; }
.site-footer__bottom {
  padding-top: 32px;
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: rgba(255,255,255,.55);
  flex-wrap: wrap;
}
.site-footer__brand { color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.6; max-width: 36ch; }
.site-footer__brand img { height: 28px; margin-bottom: 14px; filter: brightness(0) invert(1); }
@media (max-width: 800px) { .site-footer__cols { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px) { .site-footer__cols { grid-template-columns: 1fr; } }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 24px; right: 24px; bottom: 24px;
  z-index: 60;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 24px;
  max-width: 880px; margin: 0 auto;
}
@media (max-width: 700px) { .cookie-banner { flex-direction: column; align-items: stretch; padding: 18px; } }

/* METRIK BOT widget */
.bot-fab {
  position: fixed; right: 24px; bottom: 24px;
  z-index: 55;
  background: var(--bg-inverse); color: #fff;
  border: none; border-radius: 999px;
  padding: 12px 18px;
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-3);
  cursor: pointer;
}
.bot-fab__avatar { width: 26px; height: 26px; border-radius: 999px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.bot-panel {
  position: fixed; right: 24px; bottom: 24px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 100px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-3);
  z-index: 55;
  display: flex; flex-direction: column; overflow: hidden;
}

/* Form elements */
.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field label { font-size: 13px; font-weight: 600; color: var(--fg-2); }
.field input, .field select, .field textarea {
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: inherit; font-size: 14px;
  background: var(--bg-elevated); color: var(--fg);
  outline: none;
  transition: border 140ms, box-shadow 140ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* Hero */
.hero { padding: 80px 0 100px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 980px) { .hero__grid { grid-template-columns: 1fr; gap: 48px; } }
.hero__visual {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-3);
  overflow: hidden;
}

/* Logo ticker */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--divider);
  padding: 28px 0;
  background: var(--bg-muted);
}
.ticker__track {
  display: flex; gap: 64px;
  animation: scroll 40s linear infinite;
  width: max-content;
}
@keyframes scroll {
  to { transform: translateX(-50%); }
}
.ticker__logo {
  font-family: var(--km-font-sans);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--fg-3);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.ticker__logo svg { color: var(--fg-3); }

/* State chain visual */
.state-chain { display: flex; align-items: center; gap: 0; }
.state-chain__step { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.state-chain__circle {
  width: 36px; height: 36px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.state-chain__line {
  flex: 1; height: 2px;
  background: var(--border-strong); margin: 0 14px;
  position: relative;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.feature__icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature h3 { margin-bottom: 8px; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; } }
.price-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex; flex-direction: column;
  gap: 16px;
}
.price-card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent), var(--shadow-2);
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent-soft) 50%, var(--bg-elevated)) 0%, var(--bg-elevated) 36%);
  position: relative;
}
.price-card__amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.price-card__period { font-size: 14px; color: var(--fg-3); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.price-card li { display: flex; align-items: flex-start; gap: 10px; color: var(--fg-2); }
.price-card li svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }

/* Blog */
.blog-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-card { display: flex; flex-direction: column; gap: 14px; cursor: pointer; }
.blog-card__cover {
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-muted);
}
.blog-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms cubic-bezier(.2,.8,.2,1); }
.blog-card:hover .blog-card__cover img { transform: scale(1.04); }
.blog-card__meta { font-size: 12px; color: var(--fg-3); display: flex; gap: 10px; }
.blog-card h3 { font-size: 19px; line-height: 1.3; }
.blog-card p { font-size: 14px; color: var(--fg-3); }

.article {
  max-width: 760px; margin: 0 auto;
}
.article__hero {
  aspect-ratio: 16/9; border-radius: 14px; overflow: hidden;
  margin-bottom: 32px;
}
.article__hero img { width: 100%; height: 100%; object-fit: cover; }
.article h1 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 16px; }
.article__meta { color: var(--fg-3); font-size: 13px; margin-bottom: 32px; display: flex; gap: 16px; align-items: center; }
.article__avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--bg-inverse); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.article-body p, .article-body ul, .article-body blockquote { font-size: 17px; line-height: 1.7; color: var(--fg-2); margin: 18px 0; }
.article-body h2 { font-size: 26px; margin: 36px 0 14px; }
.article-body h3 { font-size: 20px; margin: 28px 0 10px; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  font-size: 19px; color: var(--fg);
  font-style: italic;
}
.article-body ul { padding-left: 24px; }
.article-body ul li { margin: 8px 0; }
.article-body code { font-family: var(--km-font-mono); background: var(--bg-muted); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* Legal pages */
.legal {
  max-width: 800px; margin: 0 auto;
}
.legal h2 { font-size: 24px; margin: 32px 0 12px; }
.legal h3 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { font-size: 15px; line-height: 1.7; color: var(--fg-2); }
.legal ul, .legal ol { padding-left: 24px; }
.legal__toc { background: var(--bg-muted); padding: 18px 24px; border-radius: 12px; margin-bottom: 32px; }
.legal__toc h4 { margin-bottom: 8px; }
.legal__toc a { display: block; padding: 4px 0; color: var(--fg-2); font-size: 14px; cursor: pointer; }
.legal__toc a:hover { color: var(--accent-deep); }

/* FAQ */
.faq__item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq__q {
  width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer;
  padding: 20px 24px;
  font-size: 16px; font-weight: 600; color: var(--fg);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq__a { padding: 0 24px 20px; color: var(--fg-2); line-height: 1.6; font-size: 15px; }

/* Tabs */
.tabs {
  display: inline-flex; padding: 4px;
  background: var(--bg-muted); border-radius: 10px;
  border: 1px solid var(--border);
}
.tabs button {
  padding: 8px 16px; border: none; background: transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; border-radius: 7px;
  color: var(--fg-3);
}
.tabs button.is-active { background: var(--bg-elevated); color: var(--fg); box-shadow: var(--shadow-1); }

/* CTA section */
.cta-band {
  background: var(--bg-inverse);
  color: var(--fg-on-dark);
  border-radius: 22px;
  padding: 64px 56px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.75); }
@media (max-width: 800px) { .cta-band { grid-template-columns: 1fr; padding: 40px 28px; } }
.cta-band::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 30%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

/* Hero illustration (dashboard mockup) */
.dash-mock {
  font-family: var(--km-font-sans);
  background: var(--bg-elevated);
  border-radius: 14px;
  overflow: hidden;
}
.dash-mock__topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
}
.dash-mock__dot { width: 10px; height: 10px; border-radius: 999px; }
.dash-mock__body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* ROI calculator */
.roi {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
}
@media (max-width: 900px) { .roi { grid-template-columns: 1fr; padding: 24px; } }
.roi__num {
  font-size: 44px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
}
.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: var(--border-strong); border-radius: 999px;
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; background: var(--accent); border-radius: 999px; border: 3px solid #fff; box-shadow: var(--shadow-2); cursor: pointer;
}
.range::-moz-range-thumb {
  width: 18px; height: 18px; background: var(--accent); border-radius: 999px; border: 3px solid #fff; box-shadow: var(--shadow-2); cursor: pointer;
}

/* Hide scrollbar utilities */
.no-scroll-bar::-webkit-scrollbar { display: none; }
.no-scroll-bar { scrollbar-width: none; }
