/* =============================================================
   heivol.com home page only (index.html). Loaded after styles.css.
   2026-10-08: three tools (Contextbox, Codegraph, Vault) for AI-native
   building of enterprise-grade applications.

   Product hues come from the product brand tiles
   (design-system/_index, amended 2026-07-25). Violet stays the lead.
   One continuous canvas: sections are transparent and an ambient glow
   (--hm-tone) follows the section in view, so there are no hard bands.
   ============================================================= */

@property --hm-tone {
  syntax: '<color>';
  inherits: true;
  initial-value: #6D47E5;
}

:root {
  --hm-cb: #D97706;   /* Contextbox amber */
  --hm-cg: #0F766E;   /* Codegraph teal */
  --hm-vt: #475569;   /* Vault slate */
  --hm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --hm-section: clamp(64px, 10vw, 128px);
}
[data-theme="dark"] {
  --hm-cb: #F59E0B;
  --hm-cg: #2DD4BF;
  --hm-vt: #94A3B8;
}

body.home {
  --hm-tone: var(--hv-ai);
  background: transparent;
  transition: --hm-tone 1100ms var(--hm-ease);
}
body.home[data-tone="cb"] { --hm-tone: var(--hm-cb); }
body.home[data-tone="cg"] { --hm-tone: var(--hm-cg); }
body.home[data-tone="vt"] { --hm-tone: var(--hm-vt); }

.hm-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70vw 60vh at 88% 4%, color-mix(in srgb, var(--hm-tone) 16%, transparent), transparent 70%),
    radial-gradient(55vw 55vh at 0% 100%, color-mix(in srgb, var(--hm-tone) 9%, transparent), transparent 70%);
}

/* Continuous canvas: neutralise the band backgrounds from styles.css */
.home main > section {
  position: relative;
  background: transparent;
  border: 0;
  padding: var(--hm-section) 0;
}
.home main > section + section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1100px, 88%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--hv-border), transparent);
}
.home .final-cta { text-align: center; }

/* Shared bits */
.hm-kicker {
  font-family: var(--hv-font-mono);
  font-size: var(--hv-text-sm);
  letter-spacing: 0.02em;
  color: var(--hv-text-tertiary);
  margin: 0 0 var(--hv-space-lg);
}
.hm-kicker span { white-space: nowrap; }
.hm-kicker .cb { color: var(--hm-cb); }
.hm-kicker .cg { color: var(--hm-cg); }
.hm-kicker .vt { color: var(--hm-vt); }
.hm-title {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 var(--hv-space-lg);
  max-width: 22ch;
}
.hm-lede {
  font-size: var(--hv-text-lg);
  line-height: var(--hv-line-height-relaxed);
  color: var(--hv-text-secondary);
  max-width: 62ch;
  margin: 0 0 var(--hv-space-2xl);
}

/* ---------- Hero ---------- */
.hm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.home .hero { background: transparent; padding-top: clamp(56px, 9vw, 112px); }
.home .hero__title {
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.home .hero__title em {
  font-style: normal;
  color: var(--hv-ai-text);
}
[data-theme="dark"] .home .hero__title em { color: var(--hv-ai); }
.home .hero__reassure { margin-top: var(--hv-space-xl); }

/* Ecosystem diagram (signature) */
.hm-eco { width: 100%; max-width: 460px; justify-self: end; }
.hm-eco svg { display: block; width: 100%; height: auto; overflow: visible; }
.hm-eco__wire { fill: none; stroke: var(--hv-border-strong); stroke-width: 1.5; }
.hm-eco__wire--cb { stroke: color-mix(in srgb, var(--hm-cb) 55%, var(--hv-border)); }
.hm-eco__wire--cg { stroke: color-mix(in srgb, var(--hm-cg) 55%, var(--hv-border)); }
.hm-eco__wire--vt { stroke: color-mix(in srgb, var(--hm-vt) 55%, var(--hv-border)); }
.hm-eco__mesh { fill: none; stroke: var(--hv-border-strong); stroke-width: 1; stroke-dasharray: 3 6; opacity: 0.7; }
.hm-eco__flow { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0.8 99.2; opacity: 0; }
.hm-eco__flow--cb { stroke: var(--hm-cb); }
.hm-eco__flow--cg { stroke: var(--hm-cg); }
.hm-eco__flow--vt { stroke: var(--hm-vt); }
.hm-eco__core rect { fill: var(--hv-surface); stroke: var(--hv-ai-border); stroke-width: 1.5; }
.hm-eco__core .t1 { fill: var(--hv-text); font: 500 14px var(--hv-font-sans); }
.hm-eco__core .t2 { fill: var(--hv-text-tertiary); font: 400 11px var(--hv-font-mono); }
.hm-eco__label { fill: var(--hv-text); font: 500 13px var(--hv-font-sans); }
.hm-eco__role { fill: var(--hv-text-tertiary); font: 400 11px var(--hv-font-mono); }

/* ---------- Problems ---------- */
.hm-problems {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
}
.hm-problem { --tone: var(--hv-ai); border-top: 2px solid var(--tone); padding-top: var(--hv-space-xl); }
.hm-problem--cb { --tone: var(--hm-cb); }
.hm-problem--cg { --tone: var(--hm-cg); }
.hm-problem--vt { --tone: var(--hm-vt); }
.hm-problem__symptom {
  font-family: var(--hv-font-mono);
  font-size: var(--hv-text-sm);
  color: var(--hv-text-tertiary);
  margin: 0 0 var(--hv-space-md);
}
.hm-problem h3 { font-size: var(--hv-text-xl); line-height: 1.25; margin: 0 0 var(--hv-space-sm); }
.hm-problem p { color: var(--hv-text-secondary); margin: 0 0 var(--hv-space-md); }
.hm-problem__fix { font-weight: var(--hv-font-medium); color: var(--hv-text); text-decoration: none; }
.hm-problem__fix span { color: var(--tone); }
.hm-problem__fix:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tool panels ---------- */
.hm-tool {
  --tone: var(--hv-ai);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.hm-tool--cb { --tone: var(--hm-cb); }
.hm-tool--cg { --tone: var(--hm-cg); }
.hm-tool--vt { --tone: var(--hm-vt); }
.hm-tool__head {
  display: flex;
  align-items: center;
  gap: var(--hv-space-md);
  margin-bottom: var(--hv-space-xl);
}
.hm-tool__logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex: none; }
.hm-tool__logo svg { width: 100%; height: 100%; display: block; }
.hm-tool__name { font-size: var(--hv-text-xl); font-weight: 600; margin: 0; }
.hm-tool__role { font-family: var(--hv-font-mono); font-size: var(--hv-text-xs); color: var(--hv-text-tertiary); margin: 0; }
.hm-tool__head .card__badge { margin-left: auto; }
.hm-tool__problem {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--hv-space-lg);
}
.hm-tool__body { color: var(--hv-text-secondary); line-height: var(--hv-line-height-relaxed); margin: 0 0 var(--hv-space-xl); }
.hm-sub {
  font-family: var(--hv-font-mono);
  font-size: var(--hv-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tone);
  margin: 0 0 var(--hv-space-md);
}
.hm-why { list-style: none; margin: 0 0 var(--hv-space-xl); padding: 0; }
.hm-why li {
  position: relative;
  padding: var(--hv-space-sm) 0 var(--hv-space-sm) 22px;
  border-top: 1px solid var(--hv-border);
  color: var(--hv-text);
}
.hm-why li:first-child { border-top: 0; }
.hm-why li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--hv-space-sm) + 0.62em);
  width: 10px;
  height: 2px;
  background: var(--tone);
}
.hm-why li span { display: block; color: var(--hv-text-secondary); font-size: var(--hv-text-sm); }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--hv-space-xl); padding: 0; list-style: none; }
.hm-chips li {
  font-family: var(--hv-font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--hv-radius-pill);
  border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--hv-border));
  color: var(--hv-text-secondary);
  background: color-mix(in srgb, var(--tone) 6%, transparent);
}
.hm-tool__links { display: flex; flex-wrap: wrap; gap: var(--hv-space-lg); }
.hm-tool__links a { font-weight: var(--hv-font-medium); color: var(--tone); }

/* Artifact: a representative example of the tool's output */
.hm-artifact {
  position: sticky;
  top: 96px;
  margin: 0;
  background: var(--hv-surface);
  border: 1px solid var(--hv-border);
  border-radius: var(--hv-radius-lg);
  box-shadow: var(--hv-shadow-lg);
  overflow: hidden;
}
.hm-artifact::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 20%, transparent));
}
.hm-artifact__bar {
  display: flex;
  justify-content: space-between;
  gap: var(--hv-space-md);
  padding: 10px 16px;
  border-bottom: 1px solid var(--hv-border);
  font-family: var(--hv-font-mono);
  font-size: 12px;
  color: var(--hv-text-tertiary);
}
.hm-artifact pre {
  margin: 0;
  padding: 16px;
  font-family: var(--hv-font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--hv-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.hm-artifact .k { color: var(--tone); }
.hm-artifact .d { color: var(--hv-text-tertiary); }
.hm-artifact figcaption {
  padding: 8px 16px 12px;
  font-size: var(--hv-text-xs);
  color: var(--hv-text-tertiary);
}

/* ---------- Better together ---------- */
.hm-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hm-link {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--hv-space-xl);
  align-items: start;
  padding: var(--hv-space-xl) 0;
  border-top: 1px solid var(--hv-border);
}
.hm-link:first-child { border-top: 0; }
.hm-pair { display: flex; align-items: center; padding-top: 6px; }
.hm-pair i { width: 12px; height: 12px; border-radius: 50%; display: block; flex: none; }
.hm-pair b { flex: 1; height: 2px; display: block; margin: 0 4px; background: linear-gradient(90deg, var(--a), var(--b)); }
.hm-pair i:first-child { background: var(--a); }
.hm-pair i:last-child { background: var(--b); }
.hm-link h3 { font-size: var(--hv-text-lg); margin: 0 0 var(--hv-space-xs); }
.hm-link p { color: var(--hv-text-secondary); margin: 0; max-width: 64ch; }
.hm-link .card__badge { margin-left: var(--hv-space-sm); vertical-align: 2px; }

/* ---------- Fits your setup ---------- */
.hm-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(24px, 3vw, 40px);
  margin: 0;
}
.hm-fit dt { font-family: var(--hv-font-mono); font-size: var(--hv-text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--hv-ai-text); margin-bottom: var(--hv-space-sm); }
[data-theme="dark"] .hm-fit dt { color: var(--hv-ai); }
.hm-fit dd { margin: 0; color: var(--hv-text-secondary); line-height: var(--hv-line-height-relaxed); }
.hm-fit dd strong { color: var(--hv-text); font-weight: var(--hv-font-medium); }

/* ---------- Consulting strip ---------- */
.hm-consult {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: var(--hv-space-2xl);
  align-items: end;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms var(--hm-ease), transform 700ms var(--hm-ease);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  .js .hm-eco__wire, .js .hm-eco__mesh { stroke-dashoffset: 1; stroke-dasharray: 1; }
  .js .hm-eco__mesh { stroke-dasharray: 1; }
  .js .hm-eco.is-in .hm-eco__wire { animation: hm-draw 900ms var(--hm-ease) forwards; animation-delay: calc(250ms + var(--w, 0) * 160ms); }
  .js .hm-eco.is-in .hm-eco__mesh { animation: hm-draw-mesh 1200ms var(--hm-ease) 900ms forwards; }
  .js .hm-eco__node { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.85); }
  .js .hm-eco.is-in .hm-eco__node { animation: hm-pop 600ms var(--hm-ease) forwards; animation-delay: calc(500ms + var(--w, 0) * 160ms); }
  .js .hm-eco__core { opacity: 0; }
  .js .hm-eco.is-in .hm-eco__core { animation: hm-fade 600ms var(--hm-ease) 100ms forwards; }
  .js .hm-eco.is-in .hm-eco__flow { animation: hm-flow 4.2s linear infinite; animation-delay: calc(1600ms + var(--w, 0) * 700ms); }
}
@keyframes hm-draw { to { stroke-dashoffset: 0; } }
@keyframes hm-draw-mesh { from { stroke-dasharray: 1; stroke-dashoffset: 1; } 99% { stroke-dasharray: 1; stroke-dashoffset: 0; } to { stroke-dasharray: 0.02 0.035; stroke-dashoffset: 0; } }
@keyframes hm-pop { to { opacity: 1; transform: none; } }
@keyframes hm-fade { to { opacity: 1; } }
@keyframes hm-flow {
  0% { stroke-dashoffset: 100; opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hm-hero, .hm-tool, .hm-consult { grid-template-columns: minmax(0, 1fr); }
  .hm-eco { justify-self: center; max-width: 380px; }
  .hm-artifact { position: static; }
  .hm-problems { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hm-link { grid-template-columns: minmax(0, 1fr); gap: var(--hv-space-md); }
  .hm-pair { width: 96px; }
  .hm-tool__head { flex-wrap: wrap; }
}

/* Diagram caption + no-motion dash pattern (pathLength=1 units) */
.hm-eco__cap { margin-top: var(--hv-space-md); font-family: var(--hv-font-mono); font-size: var(--hv-text-xs); color: var(--hv-text-tertiary); text-align: center; }
.hm-eco__mesh { stroke-dasharray: 0.02 0.035; }

/* Polish pass after first visual review */
.home .section-title { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.02em; line-height: 1.15; }
.home main > section.hm-intro { padding-bottom: 0; }
.home main > section.hm-intro + section { padding-top: clamp(40px, 6vw, 72px); }
.home main > section.hm-intro + section::before { display: none; }
.hm-fit { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .hm-fit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .hm-fit { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Accessibility pass (impeccable detect): text-safe product hues and a
   12px floor for labels. Fills and rules keep the brand-tile hues. */
:root { --hm-cb-text: #B45309; --hm-cg-text: #0F766E; --hm-vt-text: #475569; }
[data-theme="dark"] { --hm-cb-text: #F59E0B; --hm-cg-text: #2DD4BF; --hm-vt-text: #94A3B8; }
.hm-kicker .cb { color: var(--hm-cb-text); }
.hm-kicker .cg { color: var(--hm-cg-text); }
.hm-kicker .vt { color: var(--hm-vt-text); }
.hm-tool--cb, .hm-problem--cb { --tone-text: var(--hm-cb-text); }
.hm-tool--cg, .hm-problem--cg { --tone-text: var(--hm-cg-text); }
.hm-tool--vt, .hm-problem--vt { --tone-text: var(--hm-vt-text); }
.hm-sub, .hm-tool__links a, .hm-artifact .k, .hm-problem__fix span { color: var(--tone-text, var(--tone)); }
.hm-tool__role, .hm-sub, .hm-fit dt, .hm-eco__cap, .hm-artifact figcaption { font-size: 12px; }
.hm-eco__core .t2, .hm-eco__role { font-size: 12px; }
.hm-problem h3 { line-height: 1.3; }
