/* ==========================================================
   Kinobee Systems | systems.kinobee.io
   Visual identity: "comic sans but professional."
   Jua display, Open Sans body, hand-drawn borders,
   torn-paper section tears, blueprint grids on dark,
   chalk vector doodles. Tokens in :root.
   ========================================================== */

:root {
  --ink: #0c1220;
  --peri: #5cc4c4;
  --peri-deep: #2e8b8b;
  --ice: #eef3fc;
  --white: #ffffff;
  --fg-light: #1a2233;
  --muted-light: #55617a;
  --muted-dark: #a9b4cb;
  --border-light: #cfdcf1;
  --border-dark: #26324b;
  --font-display: 'Jua', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --maxw: 1080px;
  --space: 20px;
  --grid-minor: rgba(92, 196, 196, 0.055);
  --grid-major: rgba(92, 196, 196, 0.11);
}

/* ---------- Base ---------- */

.ks-page *,
.ks-page *::before,
.ks-page *::after { box-sizing: border-box; margin: 0; padding: 0; }

.ks-page {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--fg-light);
  background: var(--white);
}

.ks-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space); }
.ks-narrow { max-width: 720px; }
.ks-narrow-p { max-width: 720px; }
.ks-center { text-align: center; margin-left: auto; margin-right: auto; }

.ks-section { padding: 64px 0; position: relative; }

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

.ks-page h1,
.ks-page h2,
.ks-page h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.005em;
}

.ks-page h1 { font-size: 2.3rem; line-height: 1.15; }
.ks-page h2 { font-size: 1.75rem; line-height: 1.2; margin-bottom: 20px; }
.ks-page h3 { font-size: 1.15rem; margin-bottom: 8px; }

/* Chalk squiggle underline beneath section headings */
.ks-page h2.ks-squiggle::after {
  content: "";
  display: block;
  width: 130px;
  height: 10px;
  margin-top: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 10'%3E%3Cpath d='M2 6 C 14 2, 22 9, 34 5 S 54 2, 66 6 S 88 9, 100 4 S 120 3, 128 6' fill='none' stroke='%235cc4c4' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}
.ks-center h2.ks-squiggle::after { margin-left: auto; margin-right: auto; }

.ks-page p { margin-bottom: 16px; }
.ks-page p:last-child { margin-bottom: 0; }

.ks-eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--peri-deep);
  margin-bottom: 14px;
}

.ks-sub { font-size: 1.1rem; font-weight: 300; max-width: 640px; margin-bottom: 28px; }
.ks-strong { font-weight: 700; margin-top: 8px; }

.ks-highlight { color: var(--peri); }
.ks-light .ks-highlight, .ks-ice .ks-highlight { color: var(--peri-deep); }

/* ---------- Section palettes ---------- */

.ks-light { background: var(--white); color: var(--fg-light); }
.ks-light p { color: var(--muted-light); }
.ks-light .ks-strong, .ks-light h2, .ks-light h3 { color: var(--fg-light); }

.ks-ice { background: var(--ice); color: var(--fg-light); }
.ks-ice p { color: var(--muted-light); }
.ks-ice .ks-strong, .ks-ice h2, .ks-ice h3 { color: var(--fg-light); }

/* Dark sections carry the blueprint grid */
.ks-dark {
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px, 130px 130px, 130px 130px;
  color: var(--white);
}
.ks-dark p { color: var(--muted-dark); }
.ks-dark h1, .ks-dark h2, .ks-dark h3, .ks-dark .ks-strong { color: var(--white); }
.ks-dark .ks-eyebrow { color: var(--peri); }

/* ---------- Torn-paper tears between sections ---------- */

.ks-tear { line-height: 0; position: relative; }
.ks-tear svg { display: block; width: 100%; height: 34px; }
.ks-tear--flip svg { transform: scaleX(-1); }

.ks-tear--on-dark {
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
}
.ks-tear--on-light { background: var(--white); }
.ks-tear--on-ice { background: var(--ice); }

.ks-tear--to-dark svg path { fill: var(--ink); }
.ks-tear--to-light svg path { fill: var(--white); }
.ks-tear--to-ice svg path { fill: var(--ice); }

/* ---------- Hand-drawn borders ---------- */

.ks-hand {
  border: 2px solid var(--border-light);
  border-radius: 16px 5px 18px 6px / 6px 18px 5px 16px;
}

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

.ks-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  padding: 13px 30px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 14px 5px 16px 6px / 6px 16px 5px 14px;
  transform: rotate(-0.5deg);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ks-btn:hover { transform: rotate(0.5deg) scale(1.02); }

.ks-btn-primary { background: var(--peri); color: var(--ink); border-color: var(--peri); }
.ks-btn-primary:hover { background: var(--peri-deep); border-color: var(--peri-deep); color: var(--white); }

.ks-btn-nav {
  background: transparent;
  color: var(--white);
  border-color: var(--peri);
  padding: 8px 20px;
  font-size: 0.95rem;
}
.ks-btn-nav:hover { background: var(--peri); color: var(--ink); }

.ks-page a:focus-visible,
.ks-page .ks-btn:focus-visible,
.ks-page summary:focus-visible {
  outline: 2px solid var(--peri-deep);
  outline-offset: 3px;
}

.ks-micro { font-size: 0.85rem; margin-top: 12px; }

/* ---------- Nav ---------- */

.ks-nav {
  background: var(--ink);
  border-bottom: 2px dashed var(--border-dark);
}
.ks-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.ks-wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--white);
}
.ks-wordmark-strong { color: var(--peri); }
.ks-wordmark-light { color: var(--white); margin-left: 5px; opacity: 0.9; }

/* ---------- Hero, doodles, and the sketched wire ---------- */

.ks-hero { padding-top: 72px; overflow: hidden; }

.ks-cta-group { margin-top: 8px; position: relative; z-index: 1; }

.ks-doodle { position: absolute; pointer-events: none; display: none; }
.ks-doodle svg { display: block; width: 100%; height: auto; }
.ks-doodle path, .ks-doodle circle, .ks-doodle line {
  fill: none;
  stroke: var(--peri);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ks-doodle--faint path, .ks-doodle--faint circle { opacity: 0.45; }

.ks-doodle-gear { top: 48px; right: 4%; width: 92px; }
.ks-doodle-arrow { top: 58%; left: 46%; width: 110px; }
.ks-doodle-star { bottom: 18%; right: 10%; width: 46px; }
.ks-doodle-burst { top: 36px; left: 6%; width: 60px; }

.ks-wire { margin-top: 56px; position: relative; }
.ks-wire svg { width: 100%; height: auto; display: block; }

.ks-wire-line { fill: none; stroke: var(--border-dark); stroke-width: 2.5; stroke-linecap: round; }

.ks-wire-pulse {
  fill: none;
  stroke: var(--peri);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 90 830;
  stroke-dashoffset: 920;
  animation: ks-pulse 5s linear infinite;
}

@keyframes ks-pulse {
  from { stroke-dashoffset: 920; }
  to   { stroke-dashoffset: -920; }
}

.ks-wire-node circle {
  fill: var(--ink);
  stroke: var(--peri);
  stroke-width: 2.5;
}

.ks-wire-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dark);
  padding: 0 6px;
}

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

.ks-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 28px 0; }

.ks-card {
  background: var(--white);
  border: 2px solid var(--border-light);
  padding: 24px;
  border-radius: 18px 6px 20px 7px / 7px 20px 6px 18px;
  transform: rotate(-0.4deg);
}
.ks-card:nth-child(even) {
  border-radius: 7px 19px 6px 17px / 17px 6px 19px 7px;
  transform: rotate(0.45deg);
}

/* ---------- Steps ---------- */

.ks-steps { list-style: none; display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 32px; }

.ks-steps li {
  border-top: 2px dashed var(--border-dark);
  padding-top: 20px;
}

.ks-step-num {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  font-size: 1rem;
  color: var(--peri);
  border: 2.5px solid var(--peri);
  border-radius: 52% 46% 55% 48% / 48% 55% 45% 52%;
  transform: rotate(-2deg);
  margin-bottom: 12px;
}
.ks-steps li:nth-child(2) .ks-step-num { transform: rotate(1.5deg); border-radius: 47% 54% 45% 53% / 53% 46% 55% 47%; }
.ks-steps li:nth-child(3) .ks-step-num { transform: rotate(-1deg); border-radius: 55% 45% 52% 47% / 46% 53% 47% 54%; }

/* ---------- Testimonials (pre-launch slot) ---------- */

.ks-testimonials { margin-top: 32px; display: grid; gap: 16px; }
.ks-quote {
  border: 2px solid var(--border-light);
  border-radius: 6px 18px 7px 20px / 20px 7px 18px 6px;
  padding: 18px 22px;
  transform: rotate(0.3deg);
}
.ks-quote cite { font-style: normal; font-weight: 700; font-size: 0.9rem; }

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

.ks-faq {
  background: var(--white);
  border: 2px solid var(--border-light);
  margin-bottom: 14px;
  border-radius: 15px 5px 17px 6px / 6px 17px 5px 15px;
}
.ks-faq:nth-of-type(even) {
  border-radius: 6px 16px 5px 18px / 18px 5px 16px 6px;
}

.ks-faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 15px 44px 15px 20px;
  list-style: none;
  position: relative;
}
.ks-faq summary::-webkit-details-marker { display: none; }
.ks-faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(4deg);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--peri-deep);
}
.ks-faq[open] summary::after { content: "\2212"; }
.ks-faq p { padding: 0 20px 16px; }

/* ---------- Final CTA ---------- */

.ks-final { padding: 88px 0; overflow: hidden; }
.ks-final .ks-sub { margin-left: auto; margin-right: auto; }
.ks-final .ks-btn { margin-top: 8px; }
.ks-final .ks-doodle-star { display: block; bottom: auto; top: 22%; right: 12%; }

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

.ks-footer {
  background: var(--ink);
  border-top: 2px dashed var(--border-dark);
  padding: 32px 0;
  color: var(--muted-dark);
  font-size: 0.85rem;
}
.ks-footer-inner { display: flex; flex-direction: column; gap: 10px; }
.ks-footer a { color: var(--peri); text-decoration: none; }
.ks-footer a:hover { text-decoration: underline; }
.ks-wordmark-footer { font-size: 1.05rem; }

/* ---------- Reveal on scroll ---------- */

.ks-reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.ks-reveal.ks-in { opacity: 1; transform: none; }
.ks-page.no-observer .ks-reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ks-page * { animation: none !important; transition: none !important; }
  .ks-reveal { opacity: 1; transform: none; }
}

/* ---------- Tablet and up ---------- */

@media (min-width: 768px) {
  .ks-section { padding: 96px 0; }
  .ks-hero { padding-top: 104px; }
  .ks-page h1 { font-size: 3.1rem; }
  .ks-page h2 { font-size: 2.2rem; }
  .ks-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .ks-steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .ks-footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
  .ks-wire { margin-top: 72px; }
  .ks-wire-labels { font-size: 0.78rem; }
  .ks-doodle { display: block; }
  .ks-tear svg { height: 42px; }
}

@media (min-width: 1024px) {
  .ks-page h1 { font-size: 3.5rem; }
}
