/* ------------------------------------------------------------------
   Kappwise
   Palette: cream paper, deep green, gold
------------------------------------------------------------------ */

:root {
  --paper: #F6F3EA;
  --surface: #FFFEFA;
  --ink: #15251F;
  --muted: #4F5D56;
  --line: #DDD9CB;
  --gold: #FFC928;
  --gold-deep: #EFB300;
  --gold-pale: #FFF1C2;
  --green: #183A33;
  --green-2: #22493F;
  --green-text: #C5D3CC;
  --ok: #19704A;
  --ok-bg: #E3F1E6;
  --red: #A6402F;
  --radius: 14px;
  --wrap: 1120px;
  --font-head: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-accent: "Instrument Serif", Georgia, "Times New Roman", serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.dark :focus-visible, .site-foot :focus-visible { outline-color: var(--gold); }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
}

section { padding: clamp(60px, 9vw, 116px) 0; }
section[id] { scroll-margin-top: 72px; }

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--font-head);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.8rem); font-weight: 800; line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }

p { margin: 0 0 1em; }

.accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -0.01em;
  padding-left: 0.05em;
}

.marker {
  background: linear-gradient(transparent 60%, var(--gold) 60%, var(--gold) 92%, transparent 92%);
  padding: 0 0.1em;
  margin: 0 -0.1em;
}

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  color: var(--muted);
  max-width: 36em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font: 600 0.8rem/1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2em;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 28px;
  height: 4px;
  background: var(--gold);
}

.section-head { max-width: 46rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 1rem/1 var(--font-body);
  padding: 1em 1.4em;
  border-radius: 10px;
  border: 2px solid var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.btn-primary:hover { background: var(--gold-deep); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(21, 37, 31, 0.06); }
.btn-sm { padding: 0.7em 1em; font-size: 0.92rem; box-shadow: 0 3px 0 var(--ink); }
.btn-block { width: 100%; }
.dark .btn-primary { box-shadow: 0 4px 0 #0B1512; }

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 234, 0.93);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.05rem/1.1 var(--font-head);
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}
.brand-logo { display: block; flex: none; width: auto; height: 34px; }
.nav { display: flex; gap: 26px; }
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
}
.nav a:hover { color: var(--ink); }

.cta-short { display: none; }

.menu-btn {
  display: none;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.menu-btn svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.menu-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }

@media (max-width: 860px) {
  .head-row { gap: 12px; }
  .menu-btn { display: grid; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 20px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(21, 37, 31, 0.1);
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 14px 0;
    font-size: 1.05rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav a:last-child { border-bottom: 0; }
}
@media (max-width: 520px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
  .brand-logo { height: 30px; }
  .btn-sm { padding: 0.7em 0.85em; font-size: 0.88rem; }
}
@media (max-width: 350px) {
  .head-row { gap: 8px; }
  .brand-logo { height: 26px; }
  .menu-btn { width: 40px; height: 40px; }
}

/* ---------- Hero ---------- */

.hero { padding-top: clamp(36px, 6vw, 76px); padding-bottom: clamp(40px, 5vw, 64px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.8em 0 1.2em; }
.fineprint { font-size: 0.92rem; color: var(--muted); margin: 0; }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Demo chat */

.demo {
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: clamp(14px, 2vw, 22px);
  box-shadow: 6px 6px 0 var(--ink);
}
.demo-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.demo-tab {
  font: 600 0.85rem/1 var(--font-body);
  padding: 0.65em 0.95em;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.demo-tab:hover { background: rgba(21, 37, 31, 0.1); }
.demo-tab[aria-pressed="true"] { background: var(--ink); color: #fff; }

.chat {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--green);
  color: #fff;
}
.chat-head svg { flex: none; }
.chat-head strong { display: block; font: 700 1.02rem/1.25 var(--font-head); }
.chat-head span { font-size: 0.8rem; color: var(--green-text); }

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 360px;
  overflow-y: auto;
  padding: 16px;
  background: #F3EFE4;
}
.msg {
  flex: none;
  max-width: 85%;
  margin: 0;
  padding: 0.62em 0.9em;
  border-radius: 14px;
  font-size: 0.93rem;
  line-height: 1.45;
}
.msg.v { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.g { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }

.handoff {
  flex: none;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #BFDCC8;
  background: var(--ok-bg);
}
.handoff span {
  display: block;
  font: 700 0.75rem/1.3 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ok);
}
.handoff span::before { content: "✓ "; }
.handoff p { margin: 4px 0 0; font-size: 0.88rem; line-height: 1.45; color: var(--ink); }

.typing { display: inline-flex; gap: 4px; align-items: center; min-height: 1.45em; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #9AA59F;
  animation: blink 1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

.animate .msg, .animate .handoff { animation: pop 0.25s ease-out; }

@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.chat-foot {
  margin: 0;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.demo-note { margin: 12px 2px 0; font-size: 0.85rem; font-weight: 500; color: var(--ink); }

/* Trust strip */

.trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: clamp(40px, 6vw, 72px) 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.trust li { display: inline-flex; align-items: center; gap: 10px; }
.trust svg {
  flex: none;
  width: 22px; height: 22px;
  padding: 3px;
  border-radius: 50%;
  background: var(--gold);
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Cards ---------- */

.cards { display: grid; gap: 20px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 920px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards-3, .cards-2 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 2.4vw, 28px);
}
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }

.problem { padding-top: clamp(40px, 5vw, 64px); }
.problem .card { border-top: 4px solid var(--ink); }

/* ---------- Dark sections ---------- */

.dark { background: var(--green); color: #fff; }
.dark .lede, .dark p { color: var(--green-text); }
.dark .eyebrow { color: var(--green-text); }

/* Steps */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.steps li {
  background: var(--green-2);
  border-radius: var(--radius);
  padding: clamp(20px, 2.2vw, 26px);
}
.steps p { margin: 0; font-size: 0.98rem; }
.step-num {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  font: 800 1.3rem/1 var(--font-head);
}
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* Features */

.feature { position: relative; }
.icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--gold);
}
.icon svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tag {
  position: absolute;
  top: clamp(20px, 2.4vw, 28px);
  right: clamp(20px, 2.4vw, 28px);
  padding: 0.4em 0.75em;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font: 600 0.75rem/1.2 var(--font-body);
}
.tag-addon { background: var(--gold-pale); color: #6B4E00; }

/* ---------- Calculator ---------- */

.calc-section { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 860px) { .calc-grid { grid-template-columns: minmax(0, 1fr); } }
.calc-section .section-head { margin-bottom: 28px; }

.calc { display: grid; gap: 8px; max-width: 30rem; }
.calc label { font-weight: 600; font-size: 0.95rem; margin-top: 10px; }
.calc output { font-variant-numeric: tabular-nums; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 2px solid #C6C2B2;
  border-radius: 10px;
  padding: 0.72em 0.85em;
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold); }
textarea { resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--ink); margin: 6px 0; }

.calc-out {
  background: var(--green);
  color: #fff;
  border-radius: 20px;
  padding: clamp(24px, 3.4vw, 40px);
}
.calc-label { margin: 0; font-weight: 600; color: var(--green-text); }
.calc-big {
  margin: 0.1em 0 0.5em;
  font: 800 clamp(2.5rem, 6vw, 3.8rem)/1 var(--font-head);
  letter-spacing: -0.03em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.calc-out dl { margin: 0; }
.calc-out dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.calc-out dt { color: var(--green-text); }
.calc-out dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-out .calc-net dt { color: #fff; font-weight: 600; }
.calc-out .calc-net dd { color: var(--gold); font-size: 1.15rem; }
.calc-note { margin: 18px 0 0; font-size: 0.88rem; color: var(--green-text); }

/* ---------- Lists ---------- */

.ticks, .crosses { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li, .crosses li { position: relative; padding-left: 34px; }
.ticks li::before, .crosses li::before {
  position: absolute;
  left: 0; top: 0.12em;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font: 700 0.8rem/1 var(--font-body);
}
.ticks li::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.crosses li::before { content: "✕"; background: #F4E4DF; color: var(--red); }

.fit h3 { margin-bottom: 1em; }

/* ---------- Pricing ---------- */

.pricing { background: var(--gold); }
.pricing .eyebrow { color: var(--ink); }
.pricing .eyebrow::before { background: var(--ink); }
.price { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 0.5em 0.75em;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font: 600 0.75rem/1.2 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-plain { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.price h3 { margin-bottom: 0.2em; }
.card .price-big {
  margin: 0.1em 0 0.25em;
  font: 800 clamp(2.1rem, 4.4vw, 3rem)/1.1 var(--font-head);
  letter-spacing: -0.03em;
  color: var(--ink);
}
.price-big span { font: 500 1rem/1 var(--font-body); letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.card .price-sub { margin-bottom: 1.3em; font-weight: 500; color: var(--ink); }
.card .price-foot {
  margin-top: 1.4em;
  padding-top: 1.1em;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.pricing-note { margin: 30px 0 0; font-size: 0.95rem; font-weight: 500; max-width: 46rem; }

/* ---------- What comes next ---------- */

.next-card { background: transparent; border-style: dashed; border-color: #BDB8A6; }
.next-num {
  display: block;
  margin-bottom: 14px;
  font: 400 1.9rem/1 var(--font-accent);
  font-style: italic;
  color: var(--muted);
}
.beyond-note { margin: 26px 0 0; font-weight: 500; }

/* ---------- FAQ ---------- */

.faq { background: var(--surface); border-top: 1px solid var(--line); }
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 860px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } }
.faq .section-head { margin-bottom: 0; }

.faq-list { border-top: 2px solid var(--ink); }
details { border-bottom: 1px solid #CFCABB; }
summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  font: 700 1.08rem/1.3 var(--font-head);
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  font: 700 1.1rem/1 var(--font-body);
}
details[open] summary::after { content: "–"; }
details p { margin: 0 0 20px; color: var(--muted); max-width: 40em; }

/* ---------- Demo form ---------- */

.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 860px) { .cta-grid { grid-template-columns: minmax(0, 1fr); } }

.next {
  list-style: none;
  counter-reset: next;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.next li {
  counter-increment: next;
  position: relative;
  padding-left: 42px;
  color: #fff;
  font-weight: 500;
}
.next li::before {
  content: counter(next);
  position: absolute;
  left: 0; top: -0.1em;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font: 800 0.9rem/1 var(--font-head);
}

.form {
  background: var(--surface);
  color: var(--ink);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 32px);
  display: grid;
  gap: 16px;
}
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-left: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .form-status { margin: 0; font-weight: 600; color: var(--ok); }
.form .form-status:empty { display: none; }
.form .form-status.is-error { color: var(--red); }
.form .form-fine { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Footer ---------- */

.site-foot { background: #0F2620; color: var(--green-text); padding: 28px 0; font-size: 0.92rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.foot-row p { margin: 0; }

/* ---------- Legal page ---------- */

.legal { max-width: 44rem; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.3rem; margin-top: 1.8em; }
.legal mark { background: var(--gold); padding: 0 0.2em; }
.draft-banner {
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  margin-bottom: 2em;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
