/* ═══════════════════════════════════════════════════
   KINWISE — SHARED SITE LAYER
   Loaded after design-system/tokens.css and components.css,
   before each page's own <style>. Every colour, font and radius
   comes from tokens.css; see design-system/README.md.
   ═══════════════════════════════════════════════════ */

:root {
  /* Layout (not brand tokens) */
  --wrap: 1296px;
  --gutter: 32px;
  --section: 112px;
  --ease: cubic-bezier(.22,1,.36,1);
  /* Derived tones, mixed from tokens */
  --rule-on-pine: color-mix(in srgb, var(--on-pine) 22%, transparent);
  --label-on-pine: color-mix(in srgb, var(--on-pine-muted) 72%, var(--pine));
}

/* ─── Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  font-family:var(--font-sans); font-size:16px; line-height:1.6; font-weight:400;
  color:var(--ink); background:var(--surface);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
img { max-width:100%; }
a { color:inherit; }
button { font:inherit; color:inherit; background:none; border:0; border-radius:var(--radius-none); cursor:pointer; }
input, select, textarea { font:inherit; border-radius:var(--radius-none); }
::selection { background:var(--mist); color:var(--on-mist); }
[hidden] { display:none !important; }   /* hidden always wins over component display rules */
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ─── Focus ───────────────────────────────────── */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.on-pine :focus-visible, .nav :focus-visible, footer :focus-visible { outline-color:var(--on-pine); }

/* ─── Layout ──────────────────────────────────── */
.wrap { max-width:calc(var(--wrap) + var(--gutter) * 2); margin:0 auto; padding:0 var(--gutter); }

/* ─── Type ────────────────────────────────────── */
.display, .h2, .h3 { font-family:var(--font-sans); font-weight:400; color:inherit; }
.display { font-size:clamp(48px, 6.4vw, 92px); line-height:.98; letter-spacing:-.035em; text-wrap:balance; }
.h2 { font-size:clamp(40px, 5vw, 72px); line-height:1; letter-spacing:-.03em; text-wrap:balance; }
.h3 { font-size:24px; font-weight:500; line-height:1.25; letter-spacing:-.01em; }
.turn { font-weight:600; }                       /* the headline's weight turn */
.lede { font-size:18px; line-height:1.55; color:var(--ink-muted); }
.kicker { align-self:flex-start; margin-bottom:22px; }   /* paired with .kw-tag */

/* ─── Icons ───────────────────────────────────── */
/* Inline arrows and ticks: Instrument Sans has no ↗ → ✓ glyphs */
.ico { width:14px; height:14px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.6; }
.kw-btn svg { width:14px; height:14px; flex-shrink:0; }
.kw-btn svg.ico, .kw-btn svg.arrow { transition:transform .25s var(--ease); }
.kw-btn:hover svg.ico, .kw-btn:hover svg.arrow { transform:translate(2px,-2px); }
.kw-btn { transition:background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); white-space:nowrap; }
.kw-btn--on-pine:hover { background:var(--surface-raised); }

/* Boxed tick, as in the reference checklists */
.box-tick { width:16px; height:16px; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; border:1px solid currentColor; }
.box-tick svg { width:11px; height:11px; }

/* ─── Site header ─────────────────────────────── */
.nav {
  position:fixed; top:0; left:0; right:0; z-index:100;
  background:var(--pine); color:var(--on-pine);
  font-family:var(--font-sans); font-size:16px; line-height:1.6;
  border-bottom:1px solid transparent;
  transition:border-color .35s var(--ease);
}
.nav.scrolled { border-bottom-color:var(--rule-on-pine); }
.nav .wrap { max-width:calc(var(--wrap) + var(--gutter) * 2); margin:0 auto; padding:0 var(--gutter); }
.nav-inner { height:80px; display:flex; align-items:center; justify-content:space-between; gap:32px; transition:height .35s var(--ease); }
.nav.scrolled .nav-inner { height:68px; }
.nav-logo { display:block; flex-shrink:0; }
.nav-logo img { display:block; height:30px; width:auto; }
.nav-links { display:flex; gap:28px; list-style:none; margin-left:auto; }
.nav-links a, .nav-login {
  font-size:15px; color:var(--on-pine); text-decoration:none;
  text-underline-offset:6px; text-decoration-thickness:1px;
}
.nav-links a:hover, .nav-links a[aria-current="page"], .nav-login:hover { text-decoration:underline; }
.nav-right { display:flex; align-items:center; gap:28px; }
.nav-toggle {
  display:none; width:44px; height:44px; align-items:center; justify-content:center;
  border:1px solid var(--rule-on-pine); color:var(--on-pine);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display:block; width:18px; height:1.5px; background:var(--on-pine); position:relative;
  transition:transform .3s var(--ease), background .2s;
}
.nav-toggle span::before, .nav-toggle span::after { content:''; position:absolute; left:0; }
.nav-toggle span::before { top:-6px; } .nav-toggle span::after { top:6px; }
.nav.open .nav-toggle span { background:transparent; }
.nav.open .nav-toggle span::before { transform:translateY(6px) rotate(45deg); }
.nav.open .nav-toggle span::after { transform:translateY(-6px) rotate(-45deg); }
.nav-sheet { display:none; }

@media (max-width:900px) {
  :root { --gutter:24px; }
  .nav-links, .nav-login { display:none; }
  .nav-right { margin-left:auto; gap:12px; }
  .nav-toggle { display:inline-flex; }
  .nav-sheet {
    position:fixed; inset:68px 0 0 0; overflow-y:auto;
    background:var(--pine); padding:16px var(--gutter) 40px;
    flex-direction:column; border-top:1px solid var(--rule-on-pine);
  }
  .nav.open { border-bottom-color:var(--rule-on-pine); }
  .nav.open .nav-sheet { display:flex; }
  .nav-sheet a:not(.kw-btn) {
    font-size:28px; line-height:1.2; letter-spacing:-.02em; padding:16px 0;
    color:var(--on-pine); text-decoration:none; border-bottom:1px solid var(--rule-on-pine);
  }
  .nav-sheet a[aria-current="page"] { font-weight:600; }
  .nav-sheet .kw-btn { margin-top:28px; align-self:flex-start; }
}
@media (max-width:640px) {
  :root { --gutter:20px; }
  .nav-inner, .nav.scrolled .nav-inner { height:64px; }
  .nav-logo img { height:24px; }
  .nav-sheet { inset:64px 0 0 0; }
  .nav-right .kw-btn { display:none; }
}

/* ─── Site footer (homepage and product pages) ── */
.footer { background:var(--pine); color:var(--on-pine-muted); padding:72px 0 40px; font-size:15px; }
.footer-top {
  display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:48px;
  padding-bottom:56px; border-bottom:1px solid var(--rule-on-pine);
}
.footer-logo { display:inline-block; }
.footer-logo img { display:block; height:34px; width:auto; }
.footer-tag { margin-top:18px; max-width:360px; line-height:1.6; }
.footer-badges { margin-top:24px; display:flex; flex-wrap:wrap; gap:8px; }
.footer-badges span {
  font-size:11px; font-weight:500; line-height:1.2; letter-spacing:.12em; text-transform:uppercase;
  color:var(--on-pine); border:1px solid color-mix(in srgb, var(--on-pine) 50%, transparent); padding:6px 10px;
}
.footer h4 {
  font-family:var(--font-sans); font-size:12px; font-weight:500; letter-spacing:.14em; text-transform:uppercase;
  color:var(--label-on-pine); margin-bottom:16px;
}
.footer ul { list-style:none; display:grid; gap:12px; }
.footer a { color:var(--on-pine); text-decoration:none; text-underline-offset:4px; }
.footer a:hover { text-decoration:underline; }
.footer-bottom {
  display:flex; justify-content:space-between; gap:32px; padding-top:24px;
  font-size:13px; line-height:1.7; color:var(--label-on-pine);
}
.footer-legal { display:flex; gap:24px; flex-shrink:0; }
@media (max-width:900px) {
  .footer-top { grid-template-columns:1fr 1fr; }
  .footer-top > div:first-child { grid-column:1 / -1; }
}
@media (max-width:640px) {
  .footer { padding-bottom:120px; }
  .footer-top { grid-template-columns:1fr; gap:36px; }
  .footer-bottom { flex-direction:column; }
}

/* ─── Site footer (guides, about, privacy) ────── */
footer:has(> .ft-top) {
  background:var(--pine); color:var(--on-pine-muted); font-family:var(--font-sans);
  /* side padding lines up with .wrap in the header */
  padding:72px max(var(--gutter), calc((100% - var(--wrap)) / 2)) 40px;
}
.ft-top {
  display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:56px;
  padding-bottom:48px; border-bottom:1px solid var(--rule-on-pine);
}
.ft-logo { text-decoration:none; display:inline-flex; align-items:center; margin-bottom:18px; }
.ft-logo img { display:block; height:34px; width:auto; }
.ft-tag { font-size:15px; line-height:1.6; color:var(--on-pine-muted); max-width:360px; margin-bottom:20px; }
.ft-acc { font-size:11px; font-weight:500; letter-spacing:.12em; text-transform:uppercase; line-height:2.2; color:var(--label-on-pine); }
.ft-ct { font-size:12px; font-weight:500; letter-spacing:.14em; text-transform:uppercase; color:var(--label-on-pine); margin-bottom:16px; }
.ft-links { list-style:none; }
.ft-links li { margin-bottom:12px; }
.ft-links a { font-size:15px; color:var(--on-pine); text-decoration:none; text-underline-offset:4px; }
.ft-links a:hover { text-decoration:underline; }
.ft-bottom { padding-top:24px; display:flex; justify-content:space-between; align-items:flex-start; gap:24px; }
.ft-copy { font-size:13px; line-height:1.7; color:var(--label-on-pine); }
.ft-legal { display:flex; gap:20px; }
.ft-legal a { font-size:13px; color:var(--label-on-pine); text-decoration:none; }
.ft-legal a:hover { color:var(--on-pine); text-decoration:underline; }
@media (max-width:1024px) {
  footer:has(> .ft-top) { padding-top:56px; padding-bottom:32px; }
  .ft-top { gap:32px; }
}
@media (max-width:768px) {
  footer:has(> .ft-top) { padding-top:48px; padding-bottom:28px; }
  .ft-top { grid-template-columns:1fr 1fr; gap:32px 20px; }
  .ft-top > div:first-child { grid-column:1 / -1; }
  .ft-bottom { flex-direction:column; gap:12px; }
}
@media (max-width:480px) {
  .ft-top { grid-template-columns:1fr; }
}

/* ─── FAQ accordion ───────────────────────────── */
.faq-item { border-bottom:1px solid var(--rule); }
.faq-q {
  width:100%; display:flex; justify-content:space-between; align-items:center; gap:24px;
  padding:22px 0; text-align:left; background:none; border:0; cursor:pointer;
  font-family:var(--font-sans); font-size:19px; font-weight:500; line-height:1.4; color:var(--ink);
  text-underline-offset:4px; text-decoration-thickness:1px;
}
.faq-q:hover { text-decoration:underline; }
/* Square plus that turns into a minus when open */
.faq-icon, .faq-tog {
  position:relative; flex-shrink:0; width:28px; height:28px;
  border:1px solid var(--ink); color:var(--ink); background:transparent;
  font-size:0; transition:background .25s var(--ease), color .25s var(--ease);
}
.faq-icon::before, .faq-icon::after, .faq-tog::before, .faq-tog::after {
  content:''; position:absolute; left:50%; top:50%; width:12px; height:1.5px;
  background:currentColor; transform:translate(-50%,-50%);
  transition:transform .3s var(--ease);
}
.faq-icon::after, .faq-tog::after { transform:translate(-50%,-50%) rotate(90deg); }
.faq-item.open .faq-icon, .faq-item.open .faq-tog { background:var(--ink); color:var(--surface); }
.faq-item.open .faq-icon::after, .faq-item.open .faq-tog::after { transform:translate(-50%,-50%) rotate(0deg); }
/* Homepage and product pages: grid-rows reveal */
.faq-a { display:grid; grid-template-rows:0fr; transition:grid-template-rows .45s var(--ease); }
.faq-a > div { overflow:hidden; }
.faq-a p { padding:0 56px 24px 0; font-size:16px; line-height:1.65; color:var(--ink-muted); }
.faq-item.open .faq-a { grid-template-rows:1fr; }
/* Guides: max-height reveal */
.faq-ans { overflow:hidden; max-height:0; transition:max-height .35s ease, padding .25s; }
.faq-item.open .faq-ans { max-height:600px; padding-bottom:20px; }
.faq-ans p { font-size:16px; line-height:1.65; color:var(--ink-muted); margin-bottom:0; }
@media (max-width:640px) {
  .faq-q { font-size:17px; padding:20px 0; }
  .faq-a p { padding-right:0; }
}

/* ─── Breadcrumb and category tag (guides) ────── */
.breadcrumb-inner { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:13px; color:var(--ink-muted); }
.breadcrumb-inner a { color:var(--ink-muted); text-decoration:none; text-underline-offset:3px; }
.breadcrumb-inner a:hover { color:var(--ink); text-decoration:underline; }
.breadcrumb-inner svg { width:14px; height:14px; color:var(--rule); flex-shrink:0; }
.breadcrumb-inner span { color:var(--ink); }
.article-tag, .guide-card-tag {
  display:inline-flex; align-items:center; width:fit-content;
  font-family:var(--font-sans); font-size:12px; font-weight:500; line-height:1.2; letter-spacing:.14em; text-transform:uppercase;
  padding:7px 12px; border:1px solid var(--ink); border-radius:var(--radius-none);
  background:transparent; color:var(--ink); text-decoration:none;
}
a.article-tag:hover { background:var(--surface-raised); }

/* ─── Guide card ──────────────────────────────── */
.guide-card {
  display:flex; flex-direction:column; text-decoration:none; color:inherit;
  background:var(--surface-raised); border:1px solid var(--rule); border-top:2px solid var(--ink);
  border-radius:var(--radius-none); padding:28px 26px 24px;
  transition:background .25s var(--ease), border-color .25s var(--ease);
}
.guide-card:hover { background:var(--surface-white); border-color:var(--ink); }
.guide-card-tag { font-size:11px; padding:6px 10px; margin-bottom:18px; }
.guide-card h3 { font-family:var(--font-sans); font-size:20px; font-weight:500; line-height:1.3; letter-spacing:-.01em; color:var(--ink); margin-bottom:10px; }
.guide-card .card-excerpt {
  font-size:15px; color:var(--ink-muted); line-height:1.6; flex:1; margin-bottom:18px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.guide-card .card-link {
  display:inline-flex; align-items:center; gap:6px; font-size:15px; font-weight:500; color:var(--ink);
  text-decoration:underline; text-underline-offset:4px; text-decoration-thickness:1px;
}
.guide-card .card-link svg { width:14px; height:14px; transition:transform .2s var(--ease); }
.guide-card:hover .card-link svg { transform:translateX(3px); }

/* ─── Waitlist modal ──────────────────────────── */
.wl-overlay {
  position:fixed; inset:0; z-index:200;
  display:flex; align-items:center; justify-content:center; padding:20px;
  background:color-mix(in srgb, var(--ink) 55%, transparent);
  opacity:0; visibility:hidden; transition:opacity .3s ease, visibility .3s;
}
.wl-overlay.open { opacity:1; visibility:visible; }
.wl-modal {
  position:relative; width:100%; max-width:520px;
  background:var(--surface); color:var(--ink); border:1px solid var(--ink); border-radius:var(--radius-none);
  box-shadow:var(--shadow-block); padding:48px 44px 40px; font-family:var(--font-sans);
  transform:translateY(14px); opacity:0; transition:transform .45s var(--ease), opacity .3s;
}
.wl-overlay.open .wl-modal { transform:none; opacity:1; }
.wl-close {
  position:absolute; top:16px; right:16px; width:36px; height:36px;
  display:flex; align-items:center; justify-content:center;
  background:none; border:1px solid var(--rule); border-radius:var(--radius-none); color:var(--ink-muted);
  cursor:pointer; transition:color .2s, border-color .2s;
}
.wl-close:hover { color:var(--ink); border-color:var(--ink); }
.wl-close svg { width:16px; height:16px; }
.wl-modal h2 { font-family:var(--font-sans); font-size:36px; font-weight:400; line-height:1.05; letter-spacing:-.02em; color:var(--ink); margin:0 0 12px; }
.wl-modal .wl-sub { font-size:16px; color:var(--ink-muted); line-height:1.6; margin:0 0 28px; }
.wl-form-row { display:flex; gap:8px; margin-bottom:12px; }
.wl-form-row input[type="email"] {
  flex:1; min-width:0; height:52px; padding:0 18px; font-family:var(--font-sans); font-size:16px; color:var(--ink);
  background:var(--surface-white); border:1px solid var(--ink); border-radius:var(--radius-none); outline:none;
}
.wl-form-row input[type="email"]:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.wl-form-row input[type="email"].field-error { border:2px solid var(--coral); }
.wl-form-row .wl-submit {
  height:52px; padding:0 24px; font-family:var(--font-sans); font-size:16px; font-weight:500; white-space:nowrap;
  color:var(--surface); background:var(--ink); border:1px solid transparent; border-radius:var(--radius-none);
  cursor:pointer; transition:background .2s, opacity .2s;
}
.wl-form-row .wl-submit:hover:not(:disabled) { background:var(--pine); color:var(--on-pine); }
.wl-form-row .wl-submit:disabled { opacity:.6; cursor:not-allowed; }
.wl-form-row .wl-submit .spinner {
  display:inline-block; width:13px; height:13px; vertical-align:middle; margin-right:6px;
  border:2px solid color-mix(in srgb, var(--surface) 30%, transparent); border-top-color:var(--surface);
  border-radius:var(--radius-arch); animation:wl-spin .6s linear infinite;
}
@keyframes wl-spin { to { transform:rotate(360deg); } }
.wl-feedback { font-size:14px; line-height:1.5; margin-bottom:12px; min-height:20px; }
.wl-feedback.error { color:var(--ink); border-left:3px solid var(--coral); padding-left:10px; }
.wl-feedback.info { color:var(--ink); border-left:3px solid var(--pine); padding-left:10px; }
.wl-social-proof { font-size:14px; color:var(--ink-muted); margin-bottom:28px; }
.wl-privacy { font-size:13px; line-height:1.5; color:var(--ink-muted); margin:-16px 0 28px; }
.wl-privacy a { color:var(--ink); text-decoration:underline; text-underline-offset:3px; }
.wl-countdown { display:flex; padding-top:28px; border-top:1px solid var(--rule); }
.wl-countdown-unit { display:flex; flex-direction:column; align-items:center; flex:1; position:relative; }
.wl-countdown-unit:not(:last-child)::after { content:''; position:absolute; right:0; top:4px; bottom:4px; width:1px; background:var(--rule); }
.wl-countdown-num { font-size:36px; font-weight:400; letter-spacing:-.02em; line-height:1; color:var(--ink); margin-bottom:6px; }
.wl-countdown-label { font-size:12px; font-weight:500; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-muted); }
.wl-live-msg { text-align:center; padding-top:28px; border-top:1px solid var(--rule); font-size:24px; font-weight:500; letter-spacing:-.01em; color:var(--ink); }
.wl-success { text-align:center; padding:16px 0 8px; }
.wl-success .success-icon { width:52px; height:52px; margin:0 auto 18px; background:var(--mist); color:var(--on-mist); border-radius:var(--radius-none); display:flex; align-items:center; justify-content:center; }
.wl-success .success-icon svg { width:24px; height:24px; color:var(--on-mist); }
.wl-success h3 { font-family:var(--font-sans); font-size:28px; font-weight:500; letter-spacing:-.01em; color:var(--ink); margin:0 0 8px; }
.wl-success p { font-size:16px; color:var(--ink-muted); line-height:1.6; margin:0; }
.wl-hp { position:absolute; left:-9999px; opacity:0; }
@media (max-width:540px) {
  .wl-modal { padding:40px 24px 28px; }
  .wl-modal h2 { font-size:30px; }
  .wl-form-row { flex-direction:column; }
  .wl-form-row input[type="email"] { flex:none; width:100%; }
  .wl-form-row .wl-submit { width:100%; }
  .wl-countdown-num { font-size:30px; }
}

/* ─── Sticky mobile CTA ───────────────────────── */
.sticky-cta { display:none; }
@media (max-width:640px) {
  .sticky-cta {
    display:flex; align-items:center; gap:12px;
    position:fixed; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); z-index:90;
    padding:8px 8px 8px 16px; background:var(--surface-raised); border:1px solid var(--ink);
    transform:translateY(calc(100% + 24px)); opacity:0; pointer-events:none;
    transition:transform .45s var(--ease), opacity .3s ease;
  }
  .sticky-cta.show { transform:none; opacity:1; pointer-events:auto; }
  .sticky-cta-text { flex:1; font-size:14px; line-height:1.3; color:var(--ink-muted); }
  .sticky-cta-text strong { display:block; color:var(--ink); font-weight:600; }
  .nav.open ~ .sticky-cta { display:none; }
}

/* ─── Cookie consent (js/consent.js) ──────────── */
.kw-consent {
  position:fixed; left:0; right:0; bottom:0; z-index:150;
  display:flex; align-items:center; justify-content:center; gap:var(--space-4) var(--space-6); flex-wrap:wrap;
  padding:var(--space-4) var(--space-6) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background:var(--surface-raised); color:var(--ink); border-top:1px solid var(--ink);
  font-family:var(--font-sans);
}
.kw-consent-text { flex:1 1 320px; max-width:640px; margin:0; font-size:15px; line-height:1.5; }
.kw-consent-text a { color:var(--ink); text-decoration:underline; text-underline-offset:3px; }
.kw-consent-actions { display:flex; gap:var(--space-3); flex-wrap:wrap; }

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