/* ==========================================================================
   KaizenSight — design system
   Palette   porcelain #F7F8F5 · ink #141F33 · cobalt #2B54E0
             vermillion #DF3B22 · mist #DEE5EF · slate #5A6B85
   Type      display: Zen Kaku Gothic New · body: IBM Plex Sans · mono: IBM Plex Mono
   Signature the kaizen loop: an open circle with a vermillion sight-dot
   ========================================================================== */

:root {
  --porcelain: #F7F8F5;
  --ink: #141F33;
  --ink-soft: #22304A;
  --cobalt: #2B54E0;
  --cobalt-deep: #1E3EA8;
  --vermillion: #DF3B22;
  --mist: #DEE5EF;
  --slate: #5A6B85;
  --white: #FFFFFF;

  --font-display: "Zen Kaku Gothic New", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 14px;
  --border: 1.5px solid var(--ink);
  --border-soft: 1px solid var(--mist);
  --wrap: 1140px;
  --pad: clamp(1.1rem, 4vw, 2rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: inline-block; vertical-align: middle; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--white);
  padding: .5rem 1rem; border-radius: 0 0 8px 8px; z-index: 100;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 3.7rem); font-weight: 900; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1.1em; }
a  { color: var(--cobalt); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--cobalt-deep); }

.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 46ch; }

/* Mono eyebrow with the vermillion sight-dot */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: .55em; height: .55em;
  border-radius: 50%;
  background: var(--vermillion);
  flex: none;
}

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 248, 245, .92);
  backdrop-filter: blur(8px);
  border-bottom: var(--border-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 1.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--ink); text-decoration: none;
}
.brand .mark { color: var(--ink); }
.brand-word {
  font-family: var(--font-display); font-weight: 900;
  font-size: 1.35rem; letter-spacing: -0.01em;
}
.brand-word em { font-style: normal; color: var(--cobalt); }

.nav-list {
  display: flex; align-items: center; gap: 1.6rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-list a:not(.btn) {
  font-weight: 500; text-decoration: none; color: var(--ink-soft);
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.nav-list a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--mist); }
.nav-list a.active { color: var(--ink); border-bottom-color: var(--vermillion); }

.nav-toggle {
  display: none;
  background: none; border: var(--border); border-radius: 10px;
  width: 46px; height: 42px; cursor: pointer; position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: ""; display: block; position: absolute; left: 11px;
  width: 22px; height: 2px; background: var(--ink); transition: transform .2s, top .2s, opacity .2s;
}
.nav-toggle-bar { top: 20px; }
.nav-toggle-bar::before { top: -7px; left: 0; }
.nav-toggle-bar::after  { top: 7px;  left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { top: 0; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--cobalt); color: var(--white);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: .8rem 1.5rem; border-radius: 999px;
  border: 1.5px solid var(--cobalt);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); color: var(--white); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-small { padding: .5rem 1.1rem; font-size: .92rem; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3.5rem, 7vw, 5.5rem);
}
.hero-kanji {
  position: absolute;
  right: -2%; top: 50%;
  transform: translateY(-52%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(14rem, 30vw, 24rem);
  line-height: .9;
  color: var(--ink);
  opacity: .045;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}
.hero-inner { position: relative; max-width: 46rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
.hero-meta {
  margin-top: 3rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.8rem;
  font-family: var(--font-mono); font-size: .82rem; color: var(--slate);
}
.hero-meta span { display: inline-flex; align-items: center; gap: .5em; }
.hero-meta .icon { width: 17px; height: 17px; color: var(--vermillion); }

/* --------------------------------------------------------------------------
   Sections & cards
   -------------------------------------------------------------------------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tight { padding: clamp(2.2rem, 5vw, 3.5rem) 0; }
.section-ink { background: var(--ink); color: var(--porcelain); }
.section-ink h2, .section-ink h3 { color: var(--white); }
.section-ink .eyebrow { color: #9FB0CC; }
.section-ink a { color: #9DB5FF; }
.section-head { max-width: 44rem; margin-bottom: 2.5rem; }

.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.7rem 1.6rem 1.5rem;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 0 -6px var(--ink); }
.card .icon { color: var(--cobalt); margin-bottom: 1rem; }
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--ink-soft); font-size: .98rem; flex: 1; }
.card-link {
  font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .8rem;
}
.card-link::after { content: "→"; transition: transform .15s; }
.card-link:hover::after { transform: translateX(4px); }
a.card-wrap { text-decoration: none; color: inherit; display: block; height: 100%; }

/* Quiet variant used on subpages */
.card-quiet { border: var(--border-soft); }
.card-quiet:hover { transform: none; box-shadow: none; }

/* --------------------------------------------------------------------------
   Kaizen loop (process) list
   -------------------------------------------------------------------------- */
.loop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.loop-item { display: grid; grid-template-columns: 52px 1fr; gap: 1.1rem; align-items: start; }
.loop-badge {
  width: 46px; height: 46px; border-radius: 50%;
  border: var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 500; font-size: .95rem;
  background: var(--white);
  position: relative;
}
.loop-badge::after {
  content: ""; position: absolute; top: -4px; right: -2px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--vermillion);
}
.loop-item h3 { margin-bottom: .25rem; }
.loop-item p { margin: 0; color: var(--ink-soft); }
.section-ink .loop-badge { background: var(--ink); color: var(--porcelain); border-color: var(--porcelain); }
.section-ink .loop-item p { color: #C4CEDF; }

/* --------------------------------------------------------------------------
   Feature rows & checklists
   -------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split-reverse { grid-template-columns: .9fr 1.1fr; }

.checklist { list-style: none; margin: 1.2rem 0; padding: 0; display: grid; gap: .7rem; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: .7rem; align-items: start; }
.checklist .icon { color: var(--vermillion); width: 20px; height: 20px; margin-top: .2rem; }

/* Comparison table (cloud vs on-prem) */
.compare { width: 100%; border-collapse: collapse; background: var(--white); border: var(--border); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { padding: .95rem 1.1rem; text-align: left; border-bottom: var(--border-soft); vertical-align: top; }
.compare thead th { font-family: var(--font-display); font-size: 1.02rem; background: var(--porcelain); border-bottom: var(--border); }
.compare tbody tr:last-child td { border-bottom: none; }
.compare td:first-child { font-weight: 600; width: 24%; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }

/* Privacy banner */
.privacy-band {
  border: 2px solid var(--vermillion);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1.6rem 1.7rem;
  display: grid; grid-template-columns: 56px 1fr; gap: 1.2rem; align-items: center;
}
.privacy-band .icon { width: 44px; height: 44px; color: var(--vermillion); }
.privacy-band h3 { margin-bottom: .3rem; }
.privacy-band p { margin: 0; color: var(--ink-soft); }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.stat { border-left: 3px solid var(--vermillion); padding-left: 1.1rem; }
.stat b { font-family: var(--font-display); font-weight: 900; font-size: 2rem; display: block; line-height: 1.1; }
.stat span { color: var(--slate); font-size: .95rem; }

/* Tag chips */
.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.chips li {
  font-family: var(--font-mono); font-size: .8rem;
  border: var(--border-soft); border-radius: 999px;
  padding: .3rem .85rem; background: var(--white); color: var(--ink-soft);
}

/* Page hero (subpages) */
.page-hero { padding: clamp(3rem, 7vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: var(--border-soft); }
.page-hero .lead { max-width: 52ch; }
.breadcrumb { font-family: var(--font-mono); font-size: .8rem; margin-bottom: 1.2rem; color: var(--slate); }
.breadcrumb a { color: var(--slate); }

/* CTA band */
.cta-band { text-align: center; }
.cta-band .lead { margin-left: auto; margin-right: auto; }
.cta-band .btn { margin-top: 1.4rem; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-grid .form-field-full { grid-column: 1 / -1; }
.form-field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--white); border: var(--border); border-radius: 10px;
  padding: .75rem .9rem;
}
.form-field textarea { min-height: 150px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 3px solid var(--cobalt); outline-offset: 1px;
}
.form-note { font-size: .88rem; color: var(--slate); }

.alert { border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.4rem; font-weight: 500; }
.alert-ok { background: #E7F3EA; border: 1.5px solid #2E7D46; color: #1E5631; }
.alert-err { background: #FBEAE7; border: 1.5px solid var(--vermillion); color: #8C2415; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #C4CEDF; margin-top: clamp(3rem, 7vw, 5rem); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem; padding-top: 3.2rem; padding-bottom: 2.2rem;
}
.brand-footer, .brand-footer .mark { color: var(--white); }
.brand-footer .brand-word em { color: #9DB5FF; }
.footer-tag { margin-top: 1rem; font-size: .95rem; }
.footer-head {
  font-family: var(--font-mono); font-weight: 500; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: #8FA0BC; margin-bottom: .9rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { color: #E4E9F2; text-decoration: none; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-legal {
  border-top: 1px solid #2A3A56;
  padding-top: 1.2rem; padding-bottom: 1.6rem;
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
  font-size: .85rem; color: #8FA0BC;
}
.footer-note { margin: 0; }

/* --------------------------------------------------------------------------
   Reveal animation (JS adds .revealed; respects reduced motion)
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn { transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split, .split-reverse { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-kanji { font-size: 13rem; opacity: .04; }

  .nav-toggle { display: block; }
  .nav-list {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--porcelain);
    border-bottom: var(--border-soft);
    flex-direction: column; align-items: flex-start;
    padding: 1rem var(--pad) 1.4rem; gap: 1rem;
  }
  .nav-list.open { display: flex; }
  .site-nav { position: static; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
}

/* ==========================================================================
   Dynamic layer — AI flow animations
   All motion is disabled under prefers-reduced-motion (see bottom).
   ========================================================================== */

/* Hero split layout with visual */
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; position: relative; z-index: 1; }
.hero-visual { min-width: 0; }
.flow { width: 100%; height: auto; display: block; }
.flow-caption {
  font-family: var(--font-mono); font-size: .75rem; color: var(--slate);
  text-align: center; margin-top: .6rem;
}

/* Ambient particle network canvas behind the hero */
.net-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: .5;
}
.hero-split { position: relative; }
.hero-split .hero-kanji { z-index: 0; }

/* Page-load stagger (hero only) */
.seq { opacity: 0; transform: translateY(16px); animation: seqIn .7s ease forwards; animation-delay: calc(var(--d, 0) * 120ms); }
@keyframes seqIn { to { opacity: 1; transform: none; } }

/* Flow diagram: connector paths draw in, then dash-flow forever */
.flow-path {
  stroke: var(--cobalt); stroke-width: 2; fill: none; opacity: .85;
  stroke-dasharray: 6 8; stroke-linecap: round;
  animation: dashFlow 1.1s linear infinite;
}
@keyframes dashFlow { to { stroke-dashoffset: -14; } }

.flow-node rect { fill: var(--white); stroke: var(--ink); stroke-width: 1.6; }
.flow-node text {
  font-family: var(--font-mono); font-size: 13px; fill: var(--ink);
  text-anchor: middle; letter-spacing: .08em;
}
.flow-node { opacity: 0; animation: seqIn .6s ease forwards; animation-delay: calc(var(--nd, 0) * 140ms + .3s); }
.flow-node-out rect { stroke: var(--cobalt); }

.flow-halo { fill: var(--white); stroke: var(--mist); stroke-width: 1.5; }
.flow-agent-label {
  font-family: var(--font-display); font-weight: 900; font-size: 26px;
  fill: var(--ink); text-anchor: middle;
}
.flow-agent-sub {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  fill: var(--slate); text-anchor: middle;
}

/* The kaizen ring rotates slowly — continuous improvement, literally */
.flow-ring-spin { transform-origin: 260px 200px; animation: ringSpin 14s linear infinite; }
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* Agent halo breathes */
.flow-halo { animation: haloPulse 3.2s ease-in-out infinite; }
@keyframes haloPulse {
  0%, 100% { stroke: var(--mist); }
  50% { stroke: var(--cobalt); }
}

/* Capability ticker */
.ticker {
  overflow: hidden; border-top: var(--border-soft); border-bottom: var(--border-soft);
  background: var(--white); padding: .8rem 0;
}
.ticker-track {
  display: inline-flex; align-items: center; gap: 2.2rem;
  white-space: nowrap; will-change: transform;
  animation: tickerMove 36s linear infinite;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .12em; color: var(--ink-soft);
}
.ticker-track i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--vermillion); flex: none;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerMove { to { transform: translateX(-50%); } }

/* Loop badges run as an actual cycle: each step activates in sequence,
   forever — the kaizen loop, visibly executing. */
.loop-item .loop-badge { animation: badgeCycle 4.8s ease-in-out infinite; }
.loop-list .loop-item:nth-child(1) .loop-badge { animation-delay: 0s; }
.loop-list .loop-item:nth-child(2) .loop-badge { animation-delay: 1.2s; }
.loop-list .loop-item:nth-child(3) .loop-badge { animation-delay: 2.4s; }
.loop-list .loop-item:nth-child(4) .loop-badge { animation-delay: 3.6s; }
@keyframes badgeCycle {
  0% { background: var(--cobalt); color: #fff; border-color: var(--cobalt);
       box-shadow: 0 0 0 0 rgba(43, 84, 224, .4); }
  16% { background: var(--cobalt); color: #fff; border-color: var(--cobalt);
        box-shadow: 0 0 0 11px rgba(43, 84, 224, 0); }
  26%, 100% { background: var(--white); color: var(--ink); border-color: var(--ink);
              box-shadow: 0 0 0 0 rgba(43, 84, 224, 0); }
}
.section-ink .loop-badge { animation-name: badgeCycleInk; }
@keyframes badgeCycleInk {
  0% { background: var(--cobalt); color: #fff; border-color: var(--cobalt);
       box-shadow: 0 0 0 0 rgba(157, 181, 255, .45); }
  16% { background: var(--cobalt); color: #fff; border-color: var(--cobalt);
        box-shadow: 0 0 0 11px rgba(157, 181, 255, 0); }
  26%, 100% { background: var(--ink); color: var(--porcelain); border-color: var(--porcelain);
              box-shadow: 0 0 0 0 rgba(157, 181, 255, 0); }
}

/* Improvement sparkline inside the flow diagram: a stepped metric that
   draws itself upward, holds, and re-runs — better every cycle. */
.flow-metric rect { fill: var(--white); stroke: var(--ink); stroke-width: 1.6; }
.flow-metric-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  fill: var(--slate); text-anchor: middle;
}
.flow-spark {
  stroke: var(--cobalt); stroke-width: 2.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100;
  animation: sparkClimb 4.8s ease-in-out infinite;
}
@keyframes sparkClimb {
  0%   { stroke-dashoffset: 100; }
  70%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
.flow-spark-tip {
  fill: var(--vermillion);
  animation: sparkTip 4.8s ease-in-out infinite;
}
@keyframes sparkTip {
  0%, 62% { opacity: 0; }
  72%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

/* Privacy band: vermillion border glows gently */
.privacy-band { animation: bandGlow 4s ease-in-out infinite; }
@keyframes bandGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(223, 59, 34, 0); }
  50% { box-shadow: 0 0 24px -6px rgba(223, 59, 34, .35); }
}

/* Buttons: arrow nudge */
.btn::after { content: "→"; transition: transform .18s ease; }
.btn:hover::after { transform: translateX(4px); }
.nav-cta .btn::after { content: none; }

/* Cards lift with cobalt underline sweep */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 3px; background: var(--cobalt); transition: right .25s ease;
}
.card:hover::before { right: 0; }
.card-quiet::before { content: none; }

/* Reveal variants: children of grids cascade */
.grid .reveal:nth-child(2) { transition-delay: .08s; }
.grid .reveal:nth-child(3) { transition-delay: .16s; }
.grid .reveal:nth-child(4) { transition-delay: .24s; }
.grid .reveal:nth-child(5) { transition-delay: .32s; }
.grid .reveal:nth-child(6) { transition-delay: .4s; }

/* Responsive: stack hero visual */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; margin: 0 auto; }
}

/* Reduced motion: everything above switches off */
@media (prefers-reduced-motion: reduce) {
  .seq, .flow-node { opacity: 1; transform: none; animation: none; }
  .flow-path, .flow-ring-spin, .flow-halo,
  .ticker-track, .loop-item .loop-badge, .privacy-band { animation: none; }
  .flow-spark { animation: none; stroke-dashoffset: 0; }
  .flow-spark-tip { animation: none; opacity: 1; }
  .flow-dot { display: none; }
  .net-canvas { display: none; }
  .card::before { transition: none; }
}

/* ==========================================================================
   Service motifs — each service page hero acts out its own service
   ========================================================================== */
.page-hero-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.hero-motif { width: clamp(170px, 22vw, 230px); }
.hero-motif svg { width: 100%; height: auto; display: block; }
.motif-box { fill: var(--white); stroke: var(--ink); stroke-width: 1.6; }
.motif-box-out { stroke: var(--cobalt); }
.motif-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  fill: var(--ink); text-anchor: middle;
}
.motif-faint { stroke: var(--mist); fill: none; }

/* AI agents: tasks orbit the agent core, work in constant motion */
.motif-ring { transform-origin: 110px 110px; animation: orbit 12s linear infinite; }
.orbit-a { transform-origin: 110px 110px; animation: orbit 8s linear infinite; }
.orbit-b { transform-origin: 110px 110px; animation: orbitRev 13s linear infinite; }
.orbit-c { transform-origin: 110px 110px; animation: orbit 10s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes orbitRev { to { transform: rotate(-360deg); } }

/* Chatbots: the assistant is typing… */
.type-dot { animation: dotBounce 1.2s ease-in-out infinite; }
.type-dot.d2 { animation-delay: .15s; }
.type-dot.d3 { animation-delay: .3s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
.msg-user { animation: msgFade 6s ease-in-out infinite; }
@keyframes msgFade {
  0%, 8% { opacity: 0; transform: translateY(6px); }
  16%, 100% { opacity: 1; transform: none; }
}

/* Custom software & integration: two systems exchanging data both ways */
.flow-path-rev { animation-direction: reverse; }
.sync-core { transform-origin: 110px 110px; animation: syncPulse 2.4s ease-in-out infinite; }
@keyframes syncPulse {
  0%, 100% { transform: scale(1) rotate(45deg); }
  50% { transform: scale(1.25) rotate(45deg); }
}

/* Security: radar sweep, threats spotted, core shielded */
.radar-sweep { transform-origin: 110px 110px; animation: orbit 4s linear infinite; }
.blip { animation: blipBlink 4s ease-in-out infinite; }
.blip.b2 { animation-delay: 2s; }
@keyframes blipBlink {
  0%, 10% { opacity: 0; }
  16%, 45% { opacity: 1; }
  60%, 100% { opacity: 0; }
}
.shield-core { transform-origin: 110px 110px; animation: shieldBreathe 3.2s ease-in-out infinite; }
@keyframes shieldBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Homepage service cards: icons come alive on hover */
.card:hover > .icon, a.card-wrap:hover .icon { animation: iconPop .45s ease; }
@keyframes iconPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.15) rotate(-4deg); }
  100% { transform: scale(1); }
}

@media (max-width: 680px) {
  .page-hero-grid { grid-template-columns: 1fr; }
  .hero-motif { width: 170px; margin: 0 auto; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-motif * { animation: none !important; }
  .card:hover > .icon, a.card-wrap:hover .icon { animation: none; }
  .msg-user, .blip { opacity: 1; }
}

/* ==========================================================================
   Use cases ("In practice") & shared service grid
   ========================================================================== */
.service-grid .card h3 { font-size: 1.2rem; }

.case-ind {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--slate); margin: 0 0 .55rem;
  display: inline-flex; align-items: center; gap: .5em;
}
.case-ind::before {
  content: ""; width: .5em; height: .5em; border-radius: 50%;
  background: var(--cobalt); flex: none;
}
.case-result {
  margin: .9rem 0 0; padding-top: .8rem; border-top: var(--border-soft);
  font-weight: 600; color: var(--ink); font-size: .95rem;
}
.case-result::before { content: "→ "; color: var(--vermillion); }
.case-note {
  font-family: var(--font-mono); font-size: .78rem; color: var(--slate);
  margin-top: 1.2rem;
}

/* Five services: the last card (Managed Services) spans the full row —
   the umbrella everything else runs under. */
.service-grid a.card-wrap:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 680px) {
  .service-grid a.card-wrap:last-child:nth-child(odd) { grid-column: auto; }
}

/* ==========================================================================
   Kaizen staircase — the philosophy, animated
   ========================================================================== */
.kaizen-visual { display: grid; justify-items: center; }
.ksteps { width: 100%; max-width: 400px; height: auto; }
.ksteps-small { max-width: 230px; }
.kstep-line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.kstep-trend { stroke: var(--mist); stroke-width: 2; }
.kstep-mark { fill: var(--cobalt); opacity: .35; animation: markGlow 7s linear infinite; }
.ksteps .kstep-mark:nth-of-type(1) { animation-delay: 1.5s; }
.ksteps circle.kstep-mark:nth-of-type(2) { animation-delay: 3.1s; }
.ksteps circle.kstep-mark:nth-of-type(3) { animation-delay: 4.7s; }
.ksteps circle.kstep-mark:nth-of-type(4) { animation-delay: 6.2s; }
@keyframes markGlow {
  0%, 100% { opacity: .35; }
  4% { opacity: 1; }
  18% { opacity: .35; }
}
.kstep-dot { fill: var(--vermillion); }
.kstep-dot-static { fill: var(--vermillion); display: none; }

/* Compact kaizen strip (Services page) */
.kaizen-strip {
  background: var(--white); border: var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  display: grid; grid-template-columns: 1fr 220px; gap: 1.8rem; align-items: center;
}
.kaizen-strip h3 { margin-bottom: .4rem; }
.kaizen-strip p { margin: 0; color: var(--ink-soft); }
@media (max-width: 680px) {
  .kaizen-strip { grid-template-columns: 1fr; }
  .kaizen-strip .ksteps-small { margin: 0 auto; }
}

/* Contact topic hints */
.hint-box {
  margin-top: .8rem; background: var(--porcelain);
  border: var(--border-soft); border-left: 3px solid var(--cobalt);
  border-radius: 10px; padding: .9rem 1.1rem;
}
.hint-box p {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate); margin: 0 0 .5rem;
}
.hint-box ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; color: var(--ink-soft); }
.hint-box li { margin-bottom: .25rem; }

@media (prefers-reduced-motion: reduce) {
  .kstep-dot { display: none; }
  .kstep-dot-static { display: block; }
  .kstep-mark { animation: none; opacity: 1; }
}

/* Equal-height service rectangles: rows stretch uniformly and every card
   fills its cell, so all four pillars are the same size. */
.service-grid { grid-auto-rows: 1fr; }
.card-wrap .card { height: 100%; }

/* ==========================================================================
   The kaizen wheel (About page) — the classic continuous-improvement image:
   a PDCA wheel rolling uphill in small turns; a wedge stops it rolling back.
   ========================================================================== */
.kwheel { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.kwheel-slope { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.kwheel-ground { stroke: var(--mist); stroke-width: 2; }
.kwheel-move { animation: wheelClimb 9s ease-in-out infinite; }
.kwheel-spin { transform-origin: 0px 0px; animation: wheelSpin 2.6s linear infinite; }
.kwheel-wedge { fill: var(--cobalt); animation: wheelClimb 9s ease-in-out infinite; }
.kwheel-labels text {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  fill: var(--slate);
}
@keyframes wheelClimb {
  0%   { transform: translate(0, 0); opacity: 1; }
  72%  { transform: translate(228px, -100px); opacity: 1; }
  88%  { transform: translate(228px, -100px); opacity: 1; }
  96%  { transform: translate(228px, -100px); opacity: 0; }
  97%  { transform: translate(0, 0); opacity: 0; }
  100% { transform: translate(0, 0); opacity: 1; }
}
@keyframes wheelSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .kwheel-move, .kwheel-wedge { animation: none; transform: translate(228px, -100px); }
  .kwheel-spin { animation: none; }
}

/* Equal service rectangles: cards fill their grid row on Home and Services */
.service-grid .card { height: 100%; }

/* About: decay vs kaizen chart */
.decay-chart { background: var(--white); border: var(--border); border-radius: var(--radius); padding: 1.6rem 1.4rem 1.1rem; }
.decay-chart svg { width: 100%; height: auto; display: block; }
.dc-axis { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; fill: var(--slate); text-transform: uppercase; }
.dc-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; }
.dc-label-grey { fill: var(--slate); }
.dc-label-blue { fill: var(--cobalt); }
.dc-decay {
  stroke: var(--mist); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; animation: lineDraw 8s ease-in-out infinite;
}
.dc-kaizen {
  stroke: var(--cobalt); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; animation: lineDraw 8s linear infinite;
}
@keyframes lineDraw {
  0% { stroke-dashoffset: 100; }
  85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-decay, .dc-kaizen { animation: none; stroke-dashoffset: 0; }
  .dc-dot { display: none; }
}
