/* ==========================================================================
   KONTUR — style.css
   Mobile-first · CSS custom properties · light/dark via [data-theme]
   Sections: reset → tokens → base → layout → header → hero → components
             → sections → footer → utilities → responsive
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
img, svg, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

/* ---------- 2. Tokens ---------- */
:root {
  --font-sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, .12);
  --on-accent: #fff;

  --bg: #f7f6f3;
  --bg-alt: #efeee9;
  --surface: #fffefb;
  --surface-2: rgba(16, 16, 20, .06);
  --fg: #101014;
  --muted: #5b5b66;
  --line: #101014;
  --line-soft: rgba(16, 16, 20, .14);
  --shadow: 6px 6px 0 var(--line);
  --shadow-sm: 3px 3px 0 var(--line);

  --radius: 4px;
  --radius-lg: 8px;
  --container: 1160px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
}

[data-theme="dark"] {
  --bg: #0e0e12;
  --bg-alt: #14141a;
  --surface: #17171e;
  --surface-2: rgba(255, 255, 255, .07);
  --fg: #f2f1ee;
  --muted: #a3a3af;
  --line: #f2f1ee;
  --line-soft: rgba(242, 241, 238, .16);
  --shadow: 6px 6px 0 var(--line);
  --shadow-sm: 3px 3px 0 var(--line);
}

/* ---------- 3. Base ---------- */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 800;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 7vw, 4.4rem); }
h2 { font-size: clamp(1.75rem, 4.5vw, 3rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); letter-spacing: -.01em; }

p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 4. Layout ---------- */
.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}
.container-narrow { max-width: 760px; }

.section { padding-block: var(--section-y); }
.section-alt {
  background: var(--bg-alt);
  border-block: 2px solid var(--line);
}
.section-head {
  max-width: 720px;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
  display: grid;
  gap: .85rem;
}
.section-sub { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.12rem); max-width: 60ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }

/* ---------- 5. Header ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.is-stuck { box-shadow: 0 4px 0 var(--line-soft); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 18px; height: 18px;
  background: var(--accent);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  border-radius: 2px;
}
.brand-name { font-size: 1.1rem; }

.nav {
  display: none;
  align-items: center;
  gap: clamp(.9rem, 2vw, 1.6rem);
  margin-left: auto;
  font-size: .95rem;
  font-weight: 600;
}
.nav a:not(.btn) { position: relative; padding-block: .25rem; }
.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

.niche-switch {
  display: none;
  gap: .3rem;
  padding: .25rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.chip {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .65rem;
  border-radius: 999px;
  color: var(--muted);
  transition: background .18s, color .18s;
}
.chip:hover { color: var(--fg); }
.chip.is-active { background: var(--accent); color: var(--on-accent); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .15s, box-shadow .15s;
}
.icon-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-sm); }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

.nav.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
  padding: .5rem var(--gutter) 1rem;
}
.nav.is-open a { padding: .8rem 0; border-bottom: 1px solid var(--line-soft); }
.nav.is-open a:last-child { border-bottom: 0; margin-top: .5rem; text-align: center; }
.nav.is-open a::after { display: none; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  font-weight: 700;
  font-size: .95rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-align: center;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translate(0, 0); box-shadow: none; }

.btn-primary { background: var(--accent); border-color: var(--line); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- 7. Hero ---------- */
.hero {
  padding-top: clamp(3rem, 9vw, 6rem);
  border-bottom: 2px solid var(--line);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg);
  background-position: center;
}
.hero .container { display: grid; gap: 1.25rem; }
.hero-title { max-width: 15ch; }
.hero-title::selection { background: var(--accent); color: var(--on-accent); }
.hero-sub { max-width: 58ch; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.2rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .5rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(1.5rem, 4vw, 2.75rem);
}
.stat { background: var(--surface); padding: 1rem 1.1rem; }
.stat dt {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat dd { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; }

.marquee {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 2px solid var(--line);
  background: var(--accent);
  color: var(--on-accent);
  overflow: hidden;
  padding: .55rem 0;
}
.marquee-track {
  display: flex;
  gap: 1.25rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .18em;
  animation: marquee 26s linear infinite;
  width: max-content;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- 8. Cards / components ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.5vw, 1.7rem);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }

.features { grid-template-columns: 1fr; }
.card-index {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .1em;
  display: block;
  margin-bottom: .75rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; }

.steps { grid-template-columns: 1fr; gap: clamp(1.25rem, 3vw, 2rem); counter-reset: step; }
.step {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.5vw, 1.7rem);
  position: relative;
}
.step-num {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  margin-bottom: .9rem;
}
.step h3 { margin-bottom: .45rem; }
.step p { color: var(--muted); font-size: .96rem; }

/* pricing */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .4rem;
}
.billing-toggle .is-active { color: var(--fg); font-weight: 700; }
.save { font-style: normal; color: var(--accent); font-weight: 700; }
.switch {
  width: 52px; height: 28px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  position: relative;
  transition: background .2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--line);
  transition: transform .2s ease;
}
.switch[aria-checked="true"] { background: var(--accent-soft); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }

.pricing { grid-template-columns: 1fr; }
.price-card { display: grid; gap: .75rem; align-content: start; }
.price-card.is-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.ribbon {
  position: absolute;
  top: -14px; right: 14px;
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 999px;
}
.price { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.amount { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.04em; }
.period { color: var(--muted); font-size: .9rem; }
.price-note { color: var(--muted); font-size: .92rem; }
.ticks { display: grid; gap: .5rem; margin: .4rem 0 .6rem; font-size: .95rem; }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* quotes */
.quotes { grid-template-columns: 1fr; }
.quote blockquote { font-size: clamp(1rem, 1.7vw, 1.12rem); font-weight: 600; letter-spacing: -.01em; }
.quote figcaption { margin-top: 1rem; font-size: .88rem; color: var(--muted); font-family: var(--font-mono); }
.quote figcaption strong { color: var(--fg); }

/* accordion */
.accordion { display: grid; gap: .75rem; }
.acc-item {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.acc-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.05rem 3rem 1.05rem 1.15rem;
  font-weight: 700;
  position: relative;
  letter-spacing: -.01em;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary:hover { background: var(--accent-soft); }
.acc-icon {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 14px; height: 14px;
  transform: translateY(-50%);
}
.acc-icon::before, .acc-icon::after {
  content: "";
  position: absolute;
  background: var(--fg);
  transition: transform .2s ease, opacity .2s ease;
}
.acc-icon::before { left: 0; top: 6px; width: 14px; height: 2px; }
.acc-icon::after  { left: 6px; top: 0; width: 2px; height: 14px; }
.acc-item[open] .acc-icon::after { transform: rotate(90deg); opacity: 0; }
.acc-item[open] summary { background: var(--accent-soft); border-bottom: 2px solid var(--line); }
.acc-body { padding: 1rem 1.15rem 1.25rem; color: var(--muted); font-size: .96rem; }

/* CTA band */
.cta-band {
  background: var(--accent);
  color: var(--on-accent);
  border-block: 2px solid var(--line);
  text-align: center;
}
.cta-band .eyebrow { color: var(--on-accent); opacity: .85; }
.cta-band .section-sub { color: var(--on-accent); opacity: .9; margin-inline: auto; }
.cta-band h2 { margin-bottom: .75rem; }
.cta-form {
  display: grid;
  gap: .75rem;
  margin-top: 1.75rem;
}
.cta-form input {
  width: 100%;
  padding: .85rem 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
}
.cta-form input::placeholder { color: var(--muted); }
.cta-form .btn { border-color: var(--line); }
.cta-form .btn-primary { background: var(--fg); color: var(--bg); }
.cta-form .btn-primary:hover { background: #000; color: #fff; }
[data-theme="dark"] .cta-form .btn-primary:hover { background: #fff; color: #000; }
.form-msg { min-height: 1.4em; font-size: .9rem; font-family: var(--font-mono); }
.form-msg.is-ok { color: var(--on-accent); }
.form-msg.is-error { color: #ffe2e2; font-weight: 700; }
.cta-form.is-sent { animation: pop .5s ease; }
@keyframes pop { 50% { transform: scale(1.02); } }

/* ---------- 9. Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 2px solid var(--line);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-tag { color: var(--muted); font-size: .92rem; margin-top: .75rem; max-width: 32ch; }
.site-footer nav { display: grid; gap: .55rem; align-content: start; }
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.site-footer nav a { font-size: .95rem; width: fit-content; }
.site-footer nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  border-top: 2px solid var(--line);
  padding-block: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}

/* ---------- 10. Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* reveal-on-scroll */
.card, .step, .section-head > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.card.is-visible, .step.is-visible, .section-head > *.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .card, .step, .section-head > * { opacity: 1; transform: none; }
}

/* ---------- 11. Responsive ---------- */
@media (min-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .cta-form { grid-template-columns: 1fr auto; align-items: start; }
  .form-msg { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .nav { display: flex; }
  .niche-switch { display: inline-flex; }
  .nav-burger { display: none; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .pricing { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  .quotes { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 1200px) {
  .hero-title { max-width: 17ch; }
}
