/* the-whodunit.com: early access landing page. Dark by default, light by system or toggle.
   Colours match design canvas boards E0 and M1 (and their light twins). */

:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-2: #10161f;
  --card: #141c27;
  --card-2: #0f151d;
  --line: #1f2a36;
  --line-2: #2a3746;
  --text: #e6edf3;
  --text-2: #b4c0cb;
  --muted: #9aa7b2;
  --violet: #a159ed;
  --violet-2: #6b2fc2;
  --violet-soft: #cdb2f6;
  --cyan: #26c9ea;
  --brand-mid: #ffffff;
  --head-bg: rgba(11, 15, 20, 0.78);
  --hero-a: #2a1658;
  --hero-b: #0b3a46;
  --shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  --tip-bg: #ffffff;
  --tip-fg: #101828;
  --light-btn-bg: #ffffff;
  --light-btn-fg: #101828;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f7f7fb; --bg-2: #ffffff; --card: #ffffff; --card-2: #ffffff; --line: #e6e8ef; --line-2: #d0d5dd;
    --text: #101828; --text-2: #475467; --muted: #475467; --violet-soft: #6b2fc2; --brand-mid: #101828;
    --head-bg: rgba(247, 247, 251, 0.85); --hero-a: #ece3fd; --hero-b: #dff6fb; --shadow: 0 30px 80px rgba(16, 24, 40, 0.12);
    --tip-bg: #101828; --tip-fg: #ffffff; --light-btn-bg: #101828; --light-btn-fg: #ffffff;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7fb; --bg-2: #ffffff; --card: #ffffff; --card-2: #ffffff; --line: #e6e8ef; --line-2: #d0d5dd;
  --text: #101828; --text-2: #475467; --muted: #475467; --violet-soft: #6b2fc2; --brand-mid: #101828;
  --head-bg: rgba(247, 247, 251, 0.85); --hero-a: #ece3fd; --hero-b: #dff6fb; --shadow: 0 30px 80px rgba(16, 24, 40, 0.12);
  --tip-bg: #101828; --tip-fg: #ffffff; --light-btn-bg: #101828; --light-btn-fg: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
a { color: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 48px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--violet); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.violet { color: var(--violet-soft); }
.cyan { color: var(--cyan); }

/* header */
.site-head { position: sticky; top: 0; z-index: 5; background: var(--head-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; }
.menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 8px 12px; color: var(--text-2); text-decoration: none; border-radius: 8px; }
.menu a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-link { padding: 8px 12px; text-decoration: none; font-weight: 500; }
.theme-toggle, .menu-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.menu-toggle { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 12px; font: inherit; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; transition: transform .2s, box-shadow .2s, filter .2s; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-sm { padding: 10px 18px; border-radius: 999px; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, #a159ed, #6b2fc2); color: #fff; box-shadow: 0 8px 24px rgba(161, 89, 237, .35); }
.btn-light { background: var(--light-btn-bg); color: var(--light-btn-fg); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); font-weight: 600; }
.play { width: 22px; height: 22px; border-radius: 99px; background: var(--violet); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }

/* hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; background: radial-gradient(900px 520px at 12% 0%, var(--hero-a) 0%, transparent 62%), radial-gradient(800px 500px at 100% 30%, var(--hero-b) 0%, transparent 60%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.pill { align-self: flex-start; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(161, 89, 237, .5); color: var(--violet-soft); font-size: 13px; }
h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.04; font-weight: 800; letter-spacing: -0.03em; }
.grad { background: linear-gradient(90deg, #a159ed, #26c9ea); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--text-2); max-width: 560px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: 13px; color: var(--muted); }

.clip { position: relative; }
.clip-glow { position: absolute; inset: -40px; background: radial-gradient(closest-side, rgba(161, 89, 237, .35), transparent); }
.window { position: relative; border-radius: 18px; border: 1px solid var(--line-2); background: var(--card-2); box-shadow: var(--shadow); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); font: 12px var(--mono); color: var(--muted); }
.window-bar i { width: 10px; height: 10px; border-radius: 99px; background: #f04438; }
.window-bar i:nth-child(2) { background: #fdb022; }
.window-bar i:nth-child(3) { background: #12b76a; }
.window-bar span { margin-left: 10px; }
.window-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kpi small { display: block; font-size: 11px; color: var(--muted); }
.kpi b { font: 600 22px var(--mono); }
.chart { position: relative; height: 230px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 100%; }
.bar { flex: 1; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; transform-origin: bottom; }
.bar i:nth-child(1) { background: #e08a63; height: 58%; }
.bar i:nth-child(2) { background: #c9d1d9; height: 29%; }
.bar i:nth-child(3) { background: #4c8dff; height: 13%; }
.bar.sel { outline: 2px solid var(--text); outline-offset: 2px; }
.line { position: absolute; z-index: 2; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); overflow: visible; }
.line path { fill: none; stroke: #26c9ea; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.tip, .tip2 { position: absolute; z-index: 3; display: flex; flex-direction: column; border-radius: 10px; padding: 10px 12px; font-size: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.tip { left: 40%; top: 12%; width: 220px; background: var(--tip-bg); color: var(--tip-fg); }
.tip em { font-style: normal; color: #a159ed; margin-top: 2px; }
.tip2 { right: 22px; bottom: 22px; width: 240px; background: #101828; color: #f5f7fa; border: 1px solid #a159ed; }
.tip2 .violet { color: #cdb2f6; }
.tip2 small { color: #9aa7b2; }
.cursor { position: absolute; z-index: 4; left: 40px; top: 60px; }

.works-with { margin-top: 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; color: var(--muted); font-size: 14px; }
.works-with ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.works-with li { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-weight: 500; }

/* sections */
.section { padding: 72px 0; }
.section-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 36px; }
.section-head h2, .ea h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.section-head p { color: var(--text-2); max-width: 640px; font-size: 17px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--violet); }
.eyebrow.cyan { color: var(--cyan); }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: transform .2s; }
.feature:hover { transform: translateY(-2px); }
.viz { height: 120px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: flex-end; gap: 5px; padding: 12px; }
.viz span { flex: 1; border-radius: 4px 4px 0 0; transform-origin: bottom; }
.viz.round span { border-radius: 999px 999px 4px 4px; }
.feature h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.feature p { color: var(--text-2); font-size: 14px; }
.ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.violet-bg { background: rgba(161, 89, 237, .2); }
.cyan-bg { background: rgba(38, 201, 234, .2); }
.amber-bg { background: rgba(245, 180, 83, .2); }
.green-bg { background: rgba(127, 227, 177, .2); }
.blue-bg { background: rgba(76, 141, 255, .2); }
.grey-bg { background: rgba(128, 128, 128, .15); }

.how { background: linear-gradient(180deg, var(--bg), var(--bg-2) 40%, var(--bg)); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; position: relative; }
.steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.steps p { color: var(--text-2); max-width: 340px; }
.steps h3 { font-size: 20px; }
.steps code { font: 12px var(--mono); padding: 6px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); color: var(--violet-soft); }
.num { width: 68px; height: 68px; border-radius: 999px; background: var(--bg); display: flex; align-items: center; justify-content: center; font: 600 22px var(--mono); border: 2px solid #a159ed; box-shadow: 0 0 30px rgba(161, 89, 237, .35); }
.num.n2 { border-color: #26c9ea; box-shadow: 0 0 30px rgba(38, 201, 234, .35); }
.num.n3 { border-color: #7fe3b1; box-shadow: 0 0 30px rgba(127, 227, 177, .35); }

.ea { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; border-radius: 24px; padding: 40px; background: var(--bg-2); border: 1px solid var(--line); }
.ea-copy { display: flex; flex-direction: column; gap: 14px; }
.ea-copy > p { color: var(--text-2); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.checks li::before { content: "✓"; color: #7fe3b1; margin-right: 8px; }
.ea-form { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line-2); }
.ea-form label { font-size: 13px; color: var(--muted); }
.ea-form input, .ea-form select { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; font-size: 16px; }
.ea-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ea-form button[disabled] { opacity: .6; cursor: progress; }
.form-status:empty { display: none; }
.form-status { font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.form-status.ok { background: rgba(18, 183, 106, .15); color: var(--text); }
.form-status.err { background: rgba(240, 68, 56, .15); color: var(--text); }

.band { border-radius: 24px; padding: 48px; background: linear-gradient(120deg, #3b1a7a, #0b3a46); color: #ffffff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.band h2 { font-size: 34px; font-weight: 800; }
.band p { color: #d0d5dd; margin-top: 8px; }
.band .btn-light { background: #ffffff; color: #101828; }
.closing { padding-top: 0; }

.site-foot { border-top: 1px solid var(--line); margin-top: 24px; padding: 48px 0 32px; color: var(--muted); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.foot-grid h2 { font-size: 14px; font-weight: 650; color: var(--text); margin: 0 0 10px; letter-spacing: 0; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 6px 0; }
.foot-grid a { color: var(--muted); text-decoration: none; }
.foot-grid a:hover { color: var(--text); text-decoration: underline; }
.foot-grid .about .brand { color: var(--text); font-size: 18px; }
.foot-grid .about p { margin: 12px 0 0; max-width: 340px; font-size: 14px; }
.copy { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.copy p { margin: 0; }

/* motion: only with JS and without reduced motion */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .bar, .js .viz span { animation: grow 1s cubic-bezier(.2,.8,.2,1) both; }
.js .line path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s cubic-bezier(.4,0,.2,1) .4s forwards; }
.js .tip { animation: pop .5s cubic-bezier(.2,.8,.2,1) 1.6s both; }
.js .tip2 { animation: pop .5s cubic-bezier(.2,.8,.2,1) 2.4s both; }
.js .cursor { animation: cursor 3.2s ease-in-out .6s both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cursor { 0% { opacity: 0; transform: translate(0, 0); } 30% { opacity: 1; } 60% { transform: translate(260px, 60px); } 100% { transform: translate(300px, 120px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .bar, .js .viz span, .js .tip, .js .tip2, .js .cursor { animation: none; }
  .js .line path { animation: none; stroke-dashoffset: 0; }
  .btn:hover, .feature:hover { transform: none; }
}

/* tablet and phone */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .wrap { padding: 0 16px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-head nav { position: absolute; top: 68px; left: 0; right: 0; }
  .menu { display: none; flex-direction: column; padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .menu.open { display: flex; }
  .menu a { padding: 12px; min-height: 44px; }
  .nav-actions .btn-sm { display: none; }
  .hero { padding: 32px 0 24px; }
  .lead { font-size: 16px; }
  .cta-row .btn { width: 100%; min-height: 52px; }
  .tip { left: 24%; top: 12%; width: 180px; }
  .tip2 { display: none; }
  .chart { height: 180px; }
  .kpi b { font-size: 17px; }
  .features, .steps, .ea { grid-template-columns: minmax(0, 1fr); }
  .ea { padding: 20px; gap: 20px; }
  .ea-form { padding: 16px; }
  .band { padding: 28px 20px; }
  .band h2 { font-size: 26px; }
  .band .btn { width: 100%; }
  .section { padding: 48px 0; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .foot-grid .about { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .kpis { gap: 6px; }
  .kpi { padding: 8px; }
  .nav { gap: 12px; }
  .nav-link { padding: 8px 6px; }
}
