/* ==========================================================================
   CHINNOVATIONS — built on the Metison design system, which is itself built
   on Celonis's (--fnd-*): the neutral ramp, the 2/4/8px radii, the display
   scale with its tight negative tracking, and the section-scoped colour
   themes that let one band flip an entire section for free.

   Two things are ours rather than Metison's:

   The mark colour. Metison is blue throughout. Chinnovations' own mark is the
   amber dotted C, so amber carries the GROUP and Metison's electric blue
   carries the METHOD — the loop, the map, the diagrams. The two never do the
   same job, which is what keeps three brands legible on one page.

   And the page commits to a single visual world: no light/dark switching, no
   prefers-color-scheme. The rhythm comes from alternating bands — black,
   white, grey, blue — declared once here and read by every component.
   ========================================================================== */

/* --- Neutral ramp (Celonis) ---------------------------------------------- */
:root {
  --black:  #000000;
  --near:   #1d1d1d;
  --n333:   #333333;
  --n4d:    #4d4d4d;
  --n66:    #666666;
  --n76:    #767676;
  --n8e:    #8e8d8d;
  --ncb:    #cbcbcb;
  --nd9:    #d9d9d9;
  --ne5:    #e5e5e5;
  --nf5:    #f5f5f5;
  --white:  #ffffff;

  /* Brand blue — the method */
  --brand:       #0029ff;
  --brand-deep:  #0022ca;
  --brand-lift:  #2c4eff;
  --brand-tint:  #8ea0ff;
  --brand-pale:  #c6cfff;
  --brand-faint: #ebedff;

  /* Amber — the group */
  --amber:      #ffaa00;
  --amber-deep: #b87a00;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: "Space Grotesk", "Inter", Helvetica, Arial, sans-serif;
  --font-sans: "Inter", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

/* --- Section-scoped themes ----------------------------------------------- */
:root, .t-black {
  --bg: #000000; --bg-2: #1d1d1d; --bg-3: #333333;
  --fg: #ffffff; --fg-mid: #cbcbcb; --fg-low: #8e8d8d;
  --line: #333333; --mark: #8ea0ff;
  color-scheme: dark;
}
.t-white {
  --bg: #ffffff; --bg-2: #f5f5f5; --bg-3: #e5e5e5;
  --fg: #000000; --fg-mid: #666666; --fg-low: #767676;
  --line: #e5e5e5; --mark: #0029ff;
  color-scheme: light;
}
.t-grey {
  --bg: #f5f5f5; --bg-2: #ffffff; --bg-3: #e5e5e5;
  --fg: #000000; --fg-mid: #666666; --fg-low: #767676;
  --line: #d9d9d9; --mark: #0029ff;
  color-scheme: light;
}
.t-blue {
  --bg: #0029ff; --bg-2: #0022ca; --bg-3: #2c4eff;
  --fg: #ffffff; --fg-mid: #c6cfff; --fg-low: #8ea0ff;
  --line: #8ea0ff; --mark: #ffffff;
  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; border-color: var(--line); }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.45;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; border-radius: 2px; }

/* --- Layout -------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 3.6vw, 3.5rem);
}

.band {
  background: var(--bg);
  color: var(--fg);
  padding-block: clamp(4rem, 8vw, 7rem);
}
.band--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.measure { max-width: 62ch; }

/* --- Type scale (Celonis --fnd-typography-*) ------------------------------ */
.ty-display {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.75rem, 6.2vw, 6.5rem);
  line-height: .98; letter-spacing: -0.02em;
}
.ty-xl {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.5rem, 4.4vw, 5rem);
  line-height: 1; letter-spacing: -0.018em;
}
.ty-l {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 3vw, 3.75rem);
  line-height: 1.05; letter-spacing: -0.015em;
}
.ty-m {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.75rem, 2.3vw, 2.75rem);
  line-height: 1.09; letter-spacing: -0.012em;
}
.ty-xxs {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.125rem; line-height: 1.33; letter-spacing: -0.005em;
}
.p-xl { font-size: clamp(1.125rem, 1.2vw, 1.5rem); line-height: 1.34; letter-spacing: -0.012em; }
.p-l  { font-size: 1.125rem; line-height: 1.45; letter-spacing: -0.01em; }
.p-m  { font-size: 1rem; line-height: 1.5; letter-spacing: -0.008em; }
.p-s  { font-size: .875rem; line-height: 1.5; letter-spacing: -0.005em; }

h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
.stack > * + * { margin-top: 1rem; }
.stack-l > * + * { margin-top: 1.75rem; }

.fg-mid { color: var(--fg-mid); }
.fg-low { color: var(--fg-low); }
.mark   { color: var(--mark); }
.amber  { color: var(--amber); }

/* --- Links & buttons ----------------------------------------------------- */
a { color: inherit; }
.lnk {
  color: var(--mark); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .18s var(--ease);
}
.lnk:hover { border-bottom-color: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.4rem;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  letter-spacing: -0.01em; text-decoration: none;
  border: 0; border-radius: var(--radius-xs);
  transition: opacity .18s var(--ease);
}
.btn:hover { opacity: .85; }

/* --- Nav ----------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--black) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--n333);
}
.nav .shell {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; height: 4.5rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--white); }
.brand img { width: 24px; height: 24px; }
.brand span {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.15rem; letter-spacing: -0.02em;
}
.nav ul { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav ul li { display: flex; }
.nav ul a { color: var(--ncb); text-decoration: none; transition: color .18s var(--ease); }
.nav ul a:hover { color: var(--white); }
.nav ul a[aria-current="page"] { color: var(--white); }
@media (max-width: 720px) {
  .nav ul { gap: 1.15rem; }
  .brand span { display: none; }
}

/* --- Panels & cards ------------------------------------------------------ */
.grid-3 {
  display: grid; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.panel {
  background: var(--bg);
  padding: clamp(1.5rem, 2.2vw, 2rem);
  display: flex; flex-direction: column; gap: .9rem;
}
.panel__name { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem,2.2vw,2.25rem); letter-spacing: -0.022em; line-height: 1; color: var(--mark); }
.panel--ext { background: var(--bg-2); }
.panel--ext .panel__name { color: var(--fg); }
.panel__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--fg-low); }

/* --- Eras strip ---------------------------------------------------------- */
.eras {
  display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.era { background: var(--bg); padding: clamp(1.5rem, 2.2vw, 2rem); display: flex; flex-direction: column; gap: .75rem; }
.era--now { background: var(--black); color: var(--white); --fg-mid: #cbcbcb; --fg-low: #8e8d8d; --line: #333333; --mark: #8ea0ff; }
.era__v { font-family: var(--font-display); font-weight: 500; font-size: 3rem; line-height: 1; letter-spacing: -0.03em; color: var(--fg-low); }
.era--now .era__v { color: var(--amber); }
.era__stop { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--fg-low); }
.era--now .era__stop { color: var(--amber); }

/* --- Figures ------------------------------------------------------------- */
figure { margin: 0; }
.scroll { overflow-x: auto; }
figure svg { display: block; width: 100%; height: auto; color: var(--fg); }
figcaption { color: var(--fg-low); max-width: 70ch; margin-top: 1.1rem; }

svg .s-box   { fill: var(--bg-2); stroke: var(--fg); stroke-width: 1.25; }
svg .s-box.is-ext { fill: transparent; stroke: var(--fg-low); stroke-dasharray: 6 4; }
svg .s-band  { fill: var(--bg-2); stroke: var(--mark); stroke-width: 1.5; }
svg .s-lbl   { font-family: var(--font-display); font-size: 17px; font-weight: 500; fill: var(--fg); letter-spacing: -0.01em; }
svg .s-sub   { font-family: var(--font-mono); font-size: 10.5px; fill: var(--fg-mid); letter-spacing: .04em; }
svg .s-edge  { font-family: var(--font-mono); font-size: 10.5px; fill: var(--fg-mid); letter-spacing: .03em; }
svg .s-edge.is-mark { fill: var(--mark); }
svg line, svg path.s-link { stroke: currentColor; stroke-width: 1.25; fill: none; }
svg .s-mark-stroke, svg path.s-link.s-mark-stroke, svg line.s-mark-stroke { stroke: var(--mark); }
svg .s-step { fill: var(--bg-2); stroke: var(--fg-mid); stroke-width: 1.1; }
svg .s-step.is-ai { fill: var(--mark); stroke: var(--mark); }
svg .s-rule { stroke: var(--line); }

/* --- Prose (legal pages) ------------------------------------------------- */
.prose { max-width: 68ch; }
.prose h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 2vw, 2rem); line-height: 1.2; letter-spacing: -0.014em;
  margin: 3rem 0 .9rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.25rem; letter-spacing: -0.01em; margin: 1.9rem 0 .5rem;
}
.prose p { margin: 0 0 1.05rem; color: var(--fg-mid); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.15rem; color: var(--fg-mid); }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--mark); }
.prose a { color: var(--mark); }
.prose address { font-style: normal; color: var(--fg-mid); line-height: 1.6; }
.prose .callout {
  border: 1px solid var(--line); border-left: 2px solid var(--mark);
  padding: 1.2rem 1.35rem; margin: 1.75rem 0; background: var(--bg-2);
}
.prose .callout p:last-child { margin-bottom: 0; }

.toc { border: 1px solid var(--line); padding: 1.35rem 1.5rem; margin-bottom: 3rem; background: var(--bg-2); }
.toc ol { margin: .9rem 0 0; padding: 0; list-style: none; columns: 2; column-gap: 2.5rem; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: .45rem; break-inside: avoid; }
.toc a { color: var(--fg-mid); text-decoration: none; }
.toc a:hover { color: var(--mark); }
.toc .n { font-family: var(--font-mono); font-size: .72rem; color: var(--fg-low); margin-right: .6rem; }

/* --- Contact ------------------------------------------------------------- */
.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.fact { background: var(--bg); padding: 1.5rem 1.4rem 1.6rem; display: flex; flex-direction: column; gap: .65rem; }
.fact__v { font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; letter-spacing: -0.018em; line-height: 1.15; text-decoration: none; color: var(--fg); }
a.fact__v:hover { color: var(--mark); }

/* --- Footer -------------------------------------------------------------- */
.foot { background: var(--black); color: var(--white); padding-top: clamp(3rem, 6vw, 5rem); overflow: hidden; }
.foot__top { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-start; padding-bottom: 3rem; }
.foot__cols { display: flex; flex-wrap: wrap; gap: 2rem 4rem; }
.foot__cols ul { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.foot__cols a { color: var(--ncb); text-decoration: none; }
.foot__cols a:hover { color: var(--white); }
.foot__word {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(3rem, 15.5vw, 15rem);
  line-height: .8; letter-spacing: -0.045em;
  color: var(--near);
  margin: 0; padding-bottom: .06em;
  white-space: nowrap; user-select: none;
}
.foot__legal { border-top: 1px solid var(--n333); padding: 1.5rem 0 2.5rem; color: var(--n76); display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; }
