/* Knackly — brand tokens from brand/BRAND.md (E2 · D Chat theme) */
:root {
  --violet: #5B3DF5;
  --violet-deep: #4326D9;
  --mint: #2EE6A6;
  --night: #17142B;
  --mist: #F3F1FF;
  --white: #FFFFFF;
  --ink-2: #46425E;   /* secondary text on white/mist */
  --ink-3: #5A5670;   /* captions */
  --line: #E3DEFB;
  --radius-card: 24px;
  --shadow: 0 1px 2px rgba(23, 20, 43, .06), 0 8px 24px rgba(23, 20, 43, .06);
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--night);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--violet); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--violet-deep); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--violet); margin: 0 0 12px; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: clamp(44px, 7vw, 80px); font-weight: 700; }
h2 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 700; }
h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.lead { font-size: clamp(19px, 2vw, 22px); color: var(--ink-2); max-width: 620px; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p { color: var(--ink-2); margin: 16px 0 0; font-size: 19px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 17px; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--violet); color: var(--white); }
.btn-primary:hover { background: var(--violet-deep); color: var(--white); }
.btn-ghost { background: transparent; color: var(--violet); border-color: var(--violet); }
.btn-ghost:hover { background: var(--white); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(243, 241, 255, .88); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--night); font-weight: 700; font-size: 28px; letter-spacing: -0.03em; }
.brand img { width: 40px; height: 40px; }
.nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.nav a { color: var(--night); text-decoration: none; font-weight: 500; font-size: 16px; }
.nav a:hover { color: var(--violet); }
.nav .btn { min-height: 44px; padding: 0 20px; font-size: 16px; color: var(--white); }

/* Hero */
.hero { padding: 72px 0 96px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.hero h1 .accent { color: var(--violet); }
.hero .lead { margin: 24px 0 36px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 18px; font-size: 15px; color: var(--ink-3); }

/* Conversation card (channel-agnostic) */
.convo { background: var(--white); border-radius: 28px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.convo-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.convo-head img { width: 44px; height: 44px; }
.convo-head b { display: block; font-size: 17px; }
.convo-head span { font-size: 14px; color: var(--ink-3); }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 20px; font-size: 16px; line-height: 1.45; }
.msg.you { align-self: flex-end; background: var(--violet); color: var(--white); border-bottom-right-radius: 6px; }
.msg.knack { align-self: flex-start; background: var(--mist); border-bottom-left-radius: 6px; }
.msg.done { align-self: flex-start; background: #E6FBF3; border: 1px solid #B7F1DB; border-bottom-left-radius: 6px; }
.tick { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--mint); margin-right: 6px; vertical-align: -3px; position: relative; }
.tick::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid var(--night); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.approve { display: flex; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--white); border: 1.5px solid var(--violet); color: var(--violet); }
.chip.solid { background: var(--violet); color: var(--white); }

/* Skills */
.grid-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--white); border-radius: var(--radius-card); padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.card .icon { width: 52px; height: 52px; border-radius: 16px; background: var(--mist); display: grid; place-items: center; color: var(--violet); }
.card p { margin: 0; color: var(--ink-2); }
.ask { margin-top: auto; padding: 14px 16px; border-radius: 16px; background: var(--mist); font-size: 16px; color: var(--night); }
.ask b { color: var(--violet); font-weight: 600; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: step; }
.step { background: var(--white); border-radius: var(--radius-card); padding: 32px; box-shadow: var(--shadow); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--violet); color: var(--white); font-weight: 700; margin-bottom: 18px; }
.step p { margin: 10px 0 0; color: var(--ink-2); }

/* Everywhere */
.places { display: flex; flex-wrap: wrap; gap: 12px; }
.place { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 999px; background: var(--white); box-shadow: var(--shadow); font-weight: 500; }
.place small { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); }
.dot.soon { background: var(--line); }

/* Control (dark band) */
.band { background: var(--night); color: var(--white); border-radius: 36px; padding: 72px 56px; }
.band .eyebrow { color: var(--mint); }
.band .section-head p { color: #C9C4E8; }
.grid-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feature { padding: 24px; border-radius: 20px; background: #221E3D; }
.feature h3 { font-size: 19px; }
.feature p { margin: 8px 0 0; color: #C9C4E8; font-size: 16px; }

/* Teams */
.teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.panel { background: var(--white); border-radius: 28px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--mist); font-size: 16px; }
.panel-row span { color: var(--ink-3); font-size: 14px; }
.toggle { width: 44px; height: 26px; border-radius: 999px; background: var(--violet); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); }
.toggle.off { background: #CFC8F5; }
.toggle.off::after { right: auto; left: 3px; }
.list { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 14px; }
.list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.list li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 9px; border-radius: 50%; background: var(--violet); }
.list b { color: var(--night); }

/* Early access */
.access { background: var(--white); border-radius: 36px; padding: 64px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; }
.access img { width: 96px; height: 96px; margin-bottom: 24px; }
form { display: grid; gap: 16px; }
label { font-weight: 600; font-size: 16px; display: grid; gap: 8px; }
input, textarea { font: inherit; font-size: 17px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid #D4CDF7; background: var(--mist); color: var(--night); width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--violet); background: var(--white); }
textarea { min-height: 110px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 14px; color: var(--ink-3); margin: 0; }
.form-status { font-weight: 600; margin: 0; min-height: 1.4em; }
.form-status.ok { color: #0B7A55; }
.form-status.err { color: #B42318; }

/* Footer */
.site-footer { padding: 56px 0 48px; color: var(--ink-2); font-size: 16px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer nav a { color: var(--ink-2); text-decoration: none; }
.site-footer nav a:hover { color: var(--violet); }
.legal { font-size: 14px; color: var(--ink-3); margin-top: 8px; }

/* Legal pages */
.doc { max-width: 760px; padding: 48px 0 96px; }
.doc h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 8px; }
.doc h2 { font-size: 26px; margin: 40px 0 12px; }
.doc p, .doc li { color: var(--ink-2); }
.doc .updated { color: var(--ink-3); font-size: 15px; }

/* Responsive */
@media (max-width: 960px) {
  .hero .wrap, .teams, .access { grid-template-columns: minmax(0, 1fr); }
  .grid-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .band { padding: 56px 28px; }
  .access { padding: 40px 24px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .section { padding: 72px 0; }
  .grid-4, .grid-cols { grid-template-columns: minmax(0, 1fr); }
  .nav a:not(.btn) { display: none; }
  .hero { padding: 40px 0 72px; }
  .card, .step { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* ===================== Scenes (layout) ===================== */
.sub { color: var(--ink-2); font-size: 19px; margin: 16px 0 0; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Scene 1 — hero */
.hero { padding: 64px 0 80px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; min-height: calc(100vh - 140px); }
.hero h1 .accent { color: var(--violet); }
.hero .lead { margin: 24px 0 36px; }
.stage { perspective: 1400px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.convo { width: 100%; max-width: 460px; transform-style: preserve-3d; }
.scroll-cue { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.scroll-cue::before { content: ""; width: 18px; height: 28px; border: 2px solid var(--ink-3); border-radius: 12px; box-sizing: border-box;
  background: radial-gradient(circle, var(--violet) 2.5px, transparent 3px) 50% 6px / 6px 6px no-repeat; animation: cue 1.6s infinite; }
@keyframes cue { 0% { background-position: 50% 5px; } 60% { background-position: 50% 14px; } 100% { background-position: 50% 5px; } }

/* Scene 2 — skills card stack */
.skills { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.skill-index { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 6px; counter-reset: sk; }
.skill-index li { counter-increment: sk; display: flex; align-items: center; gap: 14px; padding: 10px 0; font-size: 19px; font-weight: 500; color: var(--ink-3); transition: color .3s var(--ease); }
.skill-index li::before { content: "0" counter(sk); font-size: 13px; font-weight: 600; width: 28px; color: inherit; }
.skill-index li::after { content: ""; height: 3px; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--mint)); transition: width .4s var(--ease); }
.skill-index li.active { color: var(--night); }
.skill-index li.active::after { width: 48px; }
.stack { display: grid; gap: 20px; }
.stack-on .stack { position: relative; height: 580px; display: block;
  clip-path: inset(-120px -48px 0 -48px);      /* cards waiting below stay hidden; shadows/peeks above stay visible */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), transparent); }  /* incoming cards rise out of a soft fade */
.stack-on .skill { position: absolute; left: 0; right: 0; top: 80px; bottom: 70px; transform-origin: 50% 0; }
.skill { min-height: 360px; }
.skill h3 { font-size: 28px; }
.skill p { font-size: 18px; }

/* Scene 3 — journey */
.journey { position: relative; }
.journey-line { position: relative; height: 4px; margin: 64px 16.66% 28px; border-radius: 4px; background: var(--line); }
.journey-line b { position: absolute; inset: 0; border-radius: 4px; background: linear-gradient(90deg, var(--violet), var(--mint)); transform-origin: 0 50%; transform: scaleX(1); }
.traveller { position: absolute; top: -50px; left: 0; width: 56px; height: 56px; margin-left: -28px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.step { background: var(--white); border-radius: var(--radius-card); padding: 32px; box-shadow: var(--shadow); text-align: center; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.step::before { content: none; }
.step .num { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--violet); color: var(--white); font-weight: 700; margin-bottom: 16px; transition: background .4s var(--ease), box-shadow .4s var(--ease); }
.step p { margin: 10px 0 0; color: var(--ink-2); }
.js .journey-on .step:not(.lit) .num { background: #CFC8F5; }
.js .journey-on .step:not(.lit) { box-shadow: none; transform: scale(.97); }
.step.lit .num { box-shadow: 0 0 0 8px rgba(46, 230, 166, .25); }

/* Scene 4 — orbit */
.orbit { position: relative; height: 480px; margin-top: 8px; }
.hub { position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; transform: translate(-50%, -50%); }
.places { list-style: none; margin: 0; padding: 0; }
.place { --r: 220px; position: absolute; left: 50%; top: 50%; white-space: nowrap;
  transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a))); }
.orbit::before { content: ""; position: absolute; left: 50%; top: 50%; width: 440px; height: 440px; margin: -220px 0 0 -220px; border-radius: 50%; border: 2px dashed var(--line); }

/* Scene 5 — control band (expands to full width) */
#control { padding-left: 0; padding-right: 0; }
.band { background: var(--night); color: var(--white); padding: 96px 0; border-radius: 36px; margin: 0 24px; will-change: clip-path; }
.band .eyebrow { color: var(--mint); }
.band .sub { color: #C9C4E8; }

/* Scene 6 — teams panel */
.panel-title { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 4px 4px; }
.teams .lead { margin-top: 16px; }

/* FAQ */
.faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.faq-list { display: grid; gap: 12px; }
details { background: var(--white); border-radius: 20px; box-shadow: var(--shadow); padding: 4px 24px; }
summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 19px; padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--violet); transition: transform .3s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 20px; color: var(--ink-2); }

/* ===================== Motion primitives ===================== */
:root { --ease: cubic-bezier(.2, .75, .2, 1); }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--violet), var(--mint)); }
.cat .pill { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
.cat .spark { transform-box: fill-box; transform-origin: center; animation: twinkle 3.2s var(--ease) infinite; }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.12); } }
@keyframes twinkle { 0%, 70%, 100% { transform: scale(1) rotate(0deg); } 82% { transform: scale(1.35) rotate(45deg); } }
.cat.wink .spark { animation: wink .9s var(--ease) 1; }
@keyframes wink { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.6) rotate(90deg); } 100% { transform: scale(1) rotate(180deg); } }
.brand .cat { width: 40px; height: 40px; }
.convo-head .cat { width: 44px; height: 44px; }
.typing { align-self: flex-start; display: none; gap: 5px; padding: 14px 16px; border-radius: 20px; border-bottom-left-radius: 6px; background: var(--mist); }
.typing.on { display: inline-flex; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); opacity: .35; animation: dots 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
.chip { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.chip.press { transform: scale(.92); box-shadow: 0 0 0 6px rgba(91, 61, 245, .18); }
.convo-head span { transition: color .3s; }
.convo-head span.live { color: #0B7A55; }
.toggle { width: 44px; height: 26px; border-radius: 999px; background: #CFC8F5; position: relative; flex: none; transition: background .35s var(--ease); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; right: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--white);
  box-shadow: 0 1px 3px rgba(23, 20, 43, .25); transition: transform .35s var(--ease); }
.toggle.on { background: var(--violet); }
.toggle.on::after { transform: translateX(18px); }
.no-js .toggle[data-on="1"], html:not(.js) .toggle[data-on="1"] { background: var(--violet); }
html:not(.js) .toggle[data-on="1"]::after { transform: translateX(18px); }
.panel-row { transition: background .35s var(--ease); }
.panel-row.flash { background: #E9E4FF; }
.dot:not(.soon) { position: relative; }
.dot:not(.soon)::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--mint); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.burst { position: relative; }
.burst i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; background: var(--mint);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: fly .9s var(--ease) forwards; }
@keyframes fly { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1.2) rotate(120deg); opacity: 0; } }

/* ===================== Responsive ===================== */
@media (max-width: 960px) {
  .hero-grid, .skills, .teams, .access, .faq { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { min-height: 0; }
  .skill-index { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .journey-line { display: none; }
  .grid-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orbit { height: auto; display: flex; flex-direction: column; align-items: center; gap: 28px; }
  .orbit::before { display: none; }
  .hub { position: static; transform: none; }
  .places { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .place { position: static; transform: none !important; }
  .band { margin: 0 16px; padding: 64px 0; }
  .access { padding: 40px 24px; }
}
@media (max-width: 640px) {
  .grid-cols { grid-template-columns: minmax(0, 1fr); }
  .skill { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .progress, .scroll-cue { display: none; }
  .cat .pill, .cat .spark, .typing i, .dot::after { animation: none !important; }
  .toggle, .toggle::after, .chip { transition: none; }
}
