/* ==========================================================================
   KAANHA AI — marketing site
   Design tokens per master brief §17. No frameworks, no build step.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink:       #060812;
  --navy:      #0B1020;
  --navy-2:    #121A30;
  --violet:    #7257FF;
  --indigo:    #6650E8;
  --blue-soft: #8297FF;
  --white:     #F5F7FB;
  --silver:    #A8B2C8;
  --border:    rgba(255, 255, 255, 0.10);

  --grad-brand: linear-gradient(120deg, var(--violet), var(--indigo));

  /* 4px base spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-6: 24px;
  --s-8: 32px; --s-12: 48px; --s-16: 64px; --s-24: 96px; --s-32: 128px; --s-48: 192px;

  --r-sm: 8px; --r-md: 16px; --r-pill: 999px;

  --shadow-panel: 0 24px 80px -24px rgba(114, 87, 255, 0.25);
  --maxw: 1320px;
  --gutter: 24px;

  --font: "Bricolage Grotesque", ui-rounded, "Segoe UI Rounded", system-ui, -apple-system, sans-serif;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/BricolageGrotesque-var-latin.woff2") format("woff2");
}

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

html { scroll-behavior: smooth; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--silver);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, video, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--white);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-6);
  text-wrap: balance;
}
h1 { font-size: clamp(2.8rem, 8vw, 7rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); }
p  { margin: 0 0 var(--s-4); max-width: 62ch; }

a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: var(--white); }

:focus-visible {
  outline: 2px solid var(--blue-soft);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -100px; left: var(--s-4); z-index: 100;
  background: var(--navy-2); color: var(--white);
  padding: var(--s-3) var(--s-6); border-radius: var(--r-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: var(--s-4); }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: var(--s-32); position: relative; }
@media (max-width: 767px) { section { padding-block: var(--s-24); } }

/* Editorial helpers */
.kicker {
  display: inline-flex; align-items: center; gap: var(--s-3);
  color: var(--blue-soft);
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: var(--s-6);
}
.kicker::before {
  content: ""; width: 28px; height: 1.5px;
  background: var(--grad-brand); border-radius: 1px;
}
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.num {
  font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(130, 151, 255, 0.35);
  line-height: 1;
}

/* Grain overlay on cinematic sections (SVG feTurbulence data-URI, opacity ≤ .05) */
.grain::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: var(--s-3) var(--s-8);
  border-radius: var(--r-pill);
  font: inherit; font-weight: 600; font-size: 1rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--grad-brand); color: var(--white);
  box-shadow: 0 8px 32px -8px rgba(114, 87, 255, 0.5);
}
.btn-primary:hover {
  transform: translateY(-2px); color: var(--white);
  box-shadow: 0 14px 44px -8px rgba(114, 87, 255, 0.65);
}
.btn-secondary {
  background: transparent; color: var(--white);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--blue-soft); transform: translateY(-2px); }
.btn-ghost { background: none; border: 0; color: var(--blue-soft); padding: var(--s-3) 0; }
.btn-ghost:hover { color: var(--white); }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(6, 8, 18, 0.72);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  display: flex; align-items: center; gap: var(--s-8);
  min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s-3);
  color: var(--white); font-weight: 800; font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand svg { width: 42px; height: 28px; }
.nav-links {
  display: flex; gap: var(--s-6); list-style: none;
  margin: 0 0 0 auto; padding: 0;
}
.nav-links a {
  color: var(--silver); font-size: 0.9375rem; font-weight: 500;
  position: relative; padding-block: var(--s-2);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1.5px; background: var(--grad-brand);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { margin-left: var(--s-6); min-height: 42px; padding-block: var(--s-2); }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--white); padding: var(--s-2) var(--s-3); font: inherit; cursor: pointer;
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--navy); border-bottom: 1px solid var(--border);
    padding: var(--s-4) var(--gutter) var(--s-6);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: var(--s-3) 0; min-height: 48px; }
  .nav-cta { display: none; }
}

/* ---------- Cinematic scene blocks ---------- */
.scene {
  position: relative; overflow: hidden;
  background: var(--ink);
}
.scene-media {
  position: absolute; inset: 0; z-index: 0;
}
.scene-media video,
.scene-media img.poster {
  width: 100%; height: 100%; object-fit: cover;
}
.scene-wash {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(114, 87, 255, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(6, 8, 18, 0.75), rgba(6, 8, 18, 0.25) 35%, rgba(6, 8, 18, 0.25) 65%, rgba(6, 8, 18, 0.9));
}
.scene-content { position: relative; z-index: 4; }

.video-toggle {
  position: absolute; right: var(--s-6); bottom: var(--s-6); z-index: 5;
  background: rgba(18, 26, 48, 0.8); color: var(--white);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  min-width: 48px; min-height: 48px; padding: 0 var(--s-4);
  font: inherit; font-size: 0.875rem; cursor: pointer;
}
.video-toggle:hover { border-color: var(--blue-soft); }

/* Hero */
.hero {
  min-height: 100svh; min-height: 100dvh;
  display: flex; align-items: flex-end;
  padding-block: 0;
}
.hero .scene-content {
  padding-block: var(--s-24) var(--s-16);
  width: 100%;
}
.hero-sub { font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); max-width: 46ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-8); }
.scroll-cue {
  display: inline-flex; align-items: center; gap: var(--s-3);
  margin-top: var(--s-12); color: var(--silver); font-size: 0.875rem;
}
.scroll-cue::before {
  content: ""; width: 1.5px; height: 40px;
  background: linear-gradient(var(--blue-soft), transparent);
}

/* Scene 2 — pinned scrub */
.scene-pin { padding-block: 0; }
.scene-pin .pin-stage {
  position: relative; min-height: 100svh; min-height: 100dvh;
  display: flex; align-items: center; overflow: hidden;
  padding-top: 84px; /* clear the fixed nav while pinned */
}
.scene-pin .scene-wash {
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(114, 87, 255, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(6, 8, 18, 0.9), rgba(6, 8, 18, 0.55) 40%, rgba(6, 8, 18, 0.55) 65%, rgba(6, 8, 18, 0.95));
}
.scene-pin h2 { font-size: clamp(1.5rem, 2.6vw, 2.4rem); }
.scrub-copy { max-width: 560px; }
@media (min-width: 901px) { .scrub-copy { max-width: min(520px, 48%); } }
.instruction {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  color: var(--white); font-weight: 600; line-height: 1.4;
  border-left: 2px solid var(--violet);
  padding-left: var(--s-6); margin: var(--s-4) 0;
  max-width: 52ch;
}
.instruction .cursor { color: var(--violet); }
.workflow-steps { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-1); }
.workflow-steps li {
  display: flex; align-items: center; gap: var(--s-3);
  color: var(--silver); font-size: 0.875rem; line-height: 1.5;
  opacity: 0.35; transition: opacity 0.3s, color 0.3s;
}
.workflow-steps li::before {
  content: ""; flex: 0 0 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--border);
  transition: background 0.3s, box-shadow 0.3s;
}
.workflow-steps li.lit { opacity: 1; color: var(--white); }
.workflow-steps li.lit::before {
  background: var(--violet);
  box-shadow: 0 0 12px rgba(114, 87, 255, 0.8);
}
.scene-panels {
  position: absolute; right: 3%; top: 50%; transform: translateY(-50%);
  z-index: 4; display: grid; gap: var(--s-4); width: min(300px, 24vw);
}
@media (max-width: 900px) { .scene-panels { display: none; } }

/* Small screens: heavier wash so overlay copy stays readable on bright video regions */
@media (max-width: 767px) {
  .scene-wash {
    background:
      radial-gradient(120% 90% at 50% 110%, rgba(114, 87, 255, 0.18), transparent 60%),
      linear-gradient(180deg, rgba(6, 8, 18, 0.85), rgba(6, 8, 18, 0.55) 40%, rgba(6, 8, 18, 0.6) 65%, rgba(6, 8, 18, 0.95));
  }
}

/* Static workflow diagram (reduced-motion / no-JS equivalent) */
.workflow-diagram { margin-top: var(--s-8); overflow-x: auto; }
.workflow-diagram svg { min-width: 620px; }

/* ---------- Capability strip ---------- */
.capability-strip { background: var(--navy); border-block: 1px solid var(--border); padding-block: var(--s-16); }
.cap-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-8) var(--s-12);
}
@media (max-width: 900px) { .cap-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cap-grid { grid-template-columns: 1fr; } }
.cap {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4); position: relative;
}
.cap::before {
  content: ""; position: absolute; top: -1px; left: 0;
  height: 1.5px; width: 100%; background: var(--grad-brand);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.8s ease;
}
.cap.swept::before { transform: scaleX(1); }
.cap strong { display: block; color: var(--white); font-size: 1.125rem; font-weight: 700; margin-bottom: var(--s-1); }
.cap span { font-size: 0.9375rem; }

/* ---------- Panels & placeholders ---------- */
.panel {
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.panel-chrome {
  display: flex; gap: 6px; padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.panel-chrome i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); display: block;
}
.placeholder {
  border: 1.5px dashed var(--border);
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(114, 87, 255, 0.08), transparent),
    var(--navy-2);
  border-radius: var(--r-md);
  min-height: 240px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: var(--s-8);
}
.placeholder p {
  margin: 0; color: var(--silver); font-size: 0.9375rem; max-width: 34ch;
}
.placeholder strong { display: block; color: var(--blue-soft); font-weight: 600; margin-bottom: var(--s-2); letter-spacing: 0.04em; }
.placeholder.small { min-height: 150px; padding: var(--s-4); }
.placeholder.small p { font-size: 0.8125rem; }

/* Real product screenshots */
.ui-shot {
  display: block; width: 100%; height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
}
.panel .ui-shot { border: 0; border-radius: 0; box-shadow: none; }

/* ---------- Section layouts ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s-16); align-items: center;
}
.split.rev > .split-media { order: -1; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: var(--s-8); }
  .split.rev > .split-media { order: 0; }
}

/* Pillars */
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-6); margin-top: var(--s-16); }
@media (max-width: 900px) { .pillars-grid { grid-template-columns: 1fr; } }
.pillar {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-8);
  display: flex; flex-direction: column; gap: var(--s-4);
  transition: transform 0.25s, border-color 0.25s;
}
.pillar:hover { transform: translateY(-4px); border-color: rgba(130, 151, 255, 0.4); }
.pillar .icon { width: 44px; height: 44px; color: var(--violet); }
.pillar em { color: var(--blue-soft); font-style: normal; font-weight: 600; }
.pillar ul { margin: 0; padding-left: 1.1em; font-size: 0.9375rem; display: grid; gap: var(--s-1); }
.pillar .placeholder { margin-top: auto; }

/* Feature checklist */
.checklist { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.checklist li { display: flex; gap: var(--s-3); align-items: baseline; }
.checklist li::before {
  content: ""; flex: 0 0 16px; width: 16px; height: 16px; align-self: center;
  background: var(--grad-brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.checklist strong { color: var(--white); font-weight: 600; }

/* Story steps */
.story-steps { counter-reset: step; display: grid; gap: var(--s-8); margin-top: var(--s-16); }
.story-step {
  display: grid; grid-template-columns: 96px 1fr; gap: var(--s-8);
  align-items: start; border-top: 1px solid var(--border); padding-top: var(--s-6);
}
@media (max-width: 600px) { .story-step { grid-template-columns: 1fr; gap: var(--s-2); } }

/* Integrations */
.chip-grid { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); }
.chip {
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-6); color: var(--white);
  font-size: 0.9375rem; font-weight: 500;
  background: rgba(18, 26, 48, 0.6);
}
.chip.more { color: var(--blue-soft); border-style: dashed; }

/* Use cases */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6); margin-top: var(--s-16); }
@media (max-width: 1000px) { .cards-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cards-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-6);
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(130, 151, 255, 0.4); }
.card h3 { font-size: 1.125rem; }
.card p { font-size: 0.9375rem; margin: 0; }

/* Pricing */
.pricing-note {
  display: inline-block; background: rgba(114, 87, 255, 0.12);
  border: 1px dashed rgba(130, 151, 255, 0.4); border-radius: var(--r-sm);
  color: var(--blue-soft); font-size: 0.875rem; font-weight: 600;
  padding: var(--s-2) var(--s-4); margin-bottom: var(--s-8);
}
.tier .price { font-size: 2rem; font-weight: 800; color: var(--white); }
.tier ul { padding-left: 1.1em; font-size: 0.9375rem; display: grid; gap: var(--s-1); margin: var(--s-4) 0; }

/* Final CTA */
.final-cta { text-align: center; }
.final-cta h2 { max-width: 20ch; margin-inline: auto; }
.final-cta p { margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--navy);
  padding-block: var(--s-16); font-size: 0.9375rem;
}
.footer-grid {
  display: flex; flex-wrap: wrap; gap: var(--s-12);
  justify-content: space-between; align-items: flex-start;
}
.footer-grid nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.footer-grid a { color: var(--silver); }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--border); color: var(--silver); font-size: 0.875rem; }

/* ---------- Forms (request-demo) ---------- */
.form-page { padding-top: calc(68px + var(--s-16)); min-height: 100dvh; }
.form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4) var(--s-6);
  max-width: 760px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: var(--s-1); }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--white); font-weight: 600; font-size: 0.9375rem; }
.field input, .field select, .field textarea {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--white);
  font: inherit; font-size: 1rem;
  padding: var(--s-3) var(--s-4); min-height: 48px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--blue-soft); outline-offset: 1px; border-color: transparent;
}
.field .error { color: #FF8A9E; font-size: 0.8125rem; min-height: 1.2em; }
.form-status { margin-top: var(--s-4); font-weight: 600; }
.form-status.ok { color: var(--blue-soft); }
.form-status.fail { color: #FF8A9E; }

/* ---------- Motion & progressive enhancement ---------- */
.reveal { opacity: 0; transform: translateY(28px); }
html.no-js .reveal, html.reduced .reveal { opacity: 1; transform: none; }

/* Reduced motion: posters replace video, everything visible, no kinetic type */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .scene-media video { display: none; }
  .scene-media img.poster { display: block; }
  .video-toggle { display: none; }
  .reveal { opacity: 1; transform: none; }
}
html.reduced .scene-media video { display: none; }
html.reduced .video-toggle { display: none; }

/* Default: poster sits behind video; video fades in when ready */
.scene-media img.poster { position: absolute; inset: 0; z-index: 0; }
.scene-media video { position: relative; z-index: 1; opacity: 0; transition: opacity 0.6s; }
.scene-media video.ready { opacity: 1; }
html.no-js .scene-media video { opacity: 1; }
