/* Chapters – five flat-colour, full-screen chapter cards that stack over each other. */

:root {
  --cobalt: #2340d8;
  --tomato: #ff5b3a;
  --tomato-2: #f6502f;
  --sun: #ffc82e;
  --sun-2: #ffb81f;
  --violet: #4520a8;
  --night: #14141b;
  --paper: #ffffff;

  --bg: #f3f3f6;
  --ink: #14141b;
  --ink-2: #474857;
  --line: #d9d9e2;
  --accent: #2340d8;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --pad-x: clamp(20px, 4.5vw, 72px);
  --radius: clamp(20px, 2.4vw, 36px);
}

body { font-size: 1.0625rem; background: var(--bg); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }

/* ---------- Floating pill header ---------- */
.ch-head {
  position: absolute;
  z-index: 50;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.ch-pill {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  width: 100%;
  padding: 8px 8px 8px 16px;
  background: rgb(255 255 255 / 0.94);
  color: var(--night);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgb(20 20 27 / 0.06), 0 10px 30px -10px rgb(20 20 27 / 0.35);
}
@supports (backdrop-filter: blur(1px)) {
  .ch-pill { background: rgb(255 255 255 / 0.82); backdrop-filter: blur(14px) saturate(1.4); }
}
.ch-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  padding: 6px 4px;
  text-decoration: none;
  line-height: 1;
}
.ch-brand__mark { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; }
.ch-brand__mark i { display: block; width: 4px; border-radius: 2px; }
.ch-brand__mark i:nth-child(1) { height: 18px; background: var(--cobalt); }
.ch-brand__mark i:nth-child(2) { height: 15px; background: var(--tomato); }
.ch-brand__mark i:nth-child(3) { height: 12px; background: var(--sun); }
.ch-brand__mark i:nth-child(4) { height: 9px; background: var(--violet); }
.ch-brand__mark i:nth-child(5) { height: 6px; background: var(--night); }
.ch-brand__name { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.03em; }
.ch-brand__sub { display: none; font-size: 0.8125rem; color: #555665; letter-spacing: -0.005em; }
.ch-nav { order: 3; display: flex; flex-wrap: wrap; gap: 2px; width: 100%; }
.ch-nav a, .ch-lang {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.1;
  transition: background-color 0.15s;
}
.ch-nav a:hover { background: rgb(20 20 27 / 0.07); }
.ch-lang {
  background: var(--night);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.ch-lang:hover { background: var(--cobalt); }

@media (min-width: 700px) {
  .ch-pill { flex-wrap: nowrap; width: auto; border-radius: 999px; padding: 6px 6px 6px 18px; gap: 4px; }
  .ch-nav { order: 0; width: auto; margin-left: 12px; }
  .ch-brand { margin-right: 0; }
}
@media (min-width: 960px) {
  .ch-head { position: fixed; top: 18px; }
}
@media (min-width: 1180px) {
  .ch-brand__sub { display: inline; }
  .ch-brand__name::after { content: ""; display: inline-block; width: 1px; height: 14px; margin-left: 10px; background: #c9c9d3; vertical-align: -2px; }
}

/* ---------- Chapter cards ---------- */
main { position: relative; }
.ch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin-top: calc(var(--radius) * -1);
  padding: clamp(80px, 10vh, 100px) var(--pad-x) clamp(36px, 6vh, 64px);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -18px 40px -12px rgb(10 10 20 / 0.28);
  overflow-wrap: break-word;
}
.ch-card:first-child { margin-top: 0; border-radius: 0; box-shadow: none; padding-top: clamp(120px, 15vh, 150px); }
.ch-card > * { width: 100%; max-width: 1360px; margin-inline: auto; }

.ch-card--cobalt { background: var(--cobalt); color: #fff; }
.ch-card--tomato { background: var(--tomato); color: var(--night); }
.ch-card--tomato2 { background: var(--tomato-2); color: var(--night); }
.ch-card--sun { background: var(--sun); color: var(--night); }
.ch-card--sun2 { background: var(--sun-2); color: var(--night); }
.ch-card--violet { background: var(--violet); color: #fff; }
.ch-card--ink { background: var(--night); color: #fff; }

/* Running head: chapter progress + caption */
.ch-run {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}
.ch-dots { display: inline-flex; gap: 6px; }
.ch-dots i { display: block; width: 22px; height: 6px; border-radius: 3px; border: 1.5px solid currentColor; }
.ch-dots i.is-on { background: currentColor; width: 44px; }

.ch-title {
  margin-top: clamp(20px, 4vh, 44px);
  font-size: clamp(3.25rem, min(12vw, 17vh), 11rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.055em;
  margin-left: -0.05em;
  hyphens: manual;
}
.ch-title--hero {
  max-width: 13ch;
  font-size: clamp(3rem, min(10.4vw, 15.5vh), 9.75rem);
  line-height: 0.9;
}
.ch-title--contact {
  max-width: 14ch;
  font-size: clamp(2.75rem, min(8.4vw, 12.5vh), 8rem);
  line-height: 0.92;
}
.ch-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vh, 32px) clamp(16px, 2vw, 32px);
  margin-top: auto;
  padding-top: clamp(20px, 4vh, 48px);
}
.ch-body > * { grid-column: 1 / -1; }
.ch-headrow { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px clamp(24px, 4vw, 64px); }
.ch-headrow .ch-title { flex: 0 1 auto; }
.ch-herotop .ch-title--hero { flex: 1 1 0; min-width: 0; }
.ch-headrow .ch-intro { flex: 0 1 32ch; padding-bottom: 0.5em; }
.ch-title, .ch-big { overflow-wrap: normal; }

/* Hero chapter index: a little stack of the coming cards */
.ch-herotop { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 32px; }
.ch-toc { display: none; flex-direction: column; width: min(300px, 24vw); margin-top: clamp(20px, 4vh, 44px); }
.ch-toc a {
  display: flex;
  align-items: flex-end;
  height: clamp(44px, 6.4vh, 60px);
  margin-top: -14px;
  padding: 0 18px 10px;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 18px -10px rgb(0 0 0 / 0.45);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.2s;
}
.ch-toc a:first-child { margin-top: 0; }
.ch-toc a:last-child { height: clamp(60px, 9vh, 84px); align-items: flex-start; padding-top: 14px; border-radius: 16px; }
.ch-toc a:not(:last-child) { padding-bottom: 22px; align-items: flex-start; padding-top: 10px; }
.ch-toc a:hover { transform: translateX(-8px); }
.ch-toc--tomato { background: var(--tomato); color: var(--night); }
.ch-toc--sun { background: var(--sun); color: var(--night); }
.ch-toc--violet { background: var(--violet); color: #fff; }
.ch-toc--ink { background: var(--night); color: #fff; }
.ch-toc a:focus-visible { outline-color: #fff; }

.ch-lead { font-size: clamp(1.125rem, 1.45vw, 1.375rem); line-height: 1.45; max-width: 36ch; letter-spacing: -0.01em; }
.ch-intro { font-size: clamp(1.0625rem, 1.25vw, 1.25rem); line-height: 1.45; max-width: 34ch; letter-spacing: -0.005em; }
.ch-label { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; letter-spacing: 0.01em; }
.ch-h3 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 600; letter-spacing: -0.035em; margin-bottom: 0.4em; }
.ch-big { font-size: clamp(2.5rem, min(5.6vw, 9vh), 5.25rem); font-weight: 600; letter-spacing: -0.05em; line-height: 0.92; margin-bottom: 0.35em; }

/* Hero */
.ch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ch-btn {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--cobalt);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ch-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.5); }
.ch-tel { font-family: var(--font-mono); font-size: 0.9375rem; text-underline-offset: 4px; }
.ch-facts { display: grid; gap: 10px; font-size: 0.9375rem; }
.ch-facts div { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / 0.4); }
.ch-facts dt { font-family: var(--font-mono); font-size: 0.8125rem; opacity: 0.85; }
.ch-facts dd { font-weight: 600; text-align: right; }

/* Services */
.ch-dev p { max-width: 46ch; }
.ch-note { align-self: start; margin-top: 0.35em; padding-top: 10px; border-top: 1.5px solid currentColor; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.5; }
.ch-focus__list { display: grid; gap: 20px; margin-top: 10px; }
.ch-focus__list li { padding-top: 16px; border-top: 2px solid currentColor; }
.ch-focus__list h4 { margin: 10px 0 4px; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.03em; }
.ch-focus__list p { max-width: 34ch; hyphens: auto; }
.ch-ico { width: 36px; height: 36px; }

.ch-pair { flex: 1; display: grid; gap: 48px; padding-top: clamp(20px, 4vh, 44px); }
.ch-svc, .ch-small { display: flex; flex-direction: column; }
.ch-svc > p, .ch-small__cols { margin-top: clamp(28px, 7vh, 88px); }
.ch-pair .ch-big { font-size: clamp(3rem, min(8.4vw, 14vh), 8.5rem); line-height: 0.88; letter-spacing: -0.055em; margin-left: -0.04em; }
.ch-pair--small .ch-big { max-width: 7ch; }
.ch-faq { align-self: start; margin-top: clamp(16px, 3vh, 40px); }
.ch-svc > p { max-width: 44ch; font-size: clamp(1.0625rem, 1.2vw, 1.1875rem); }
.ch-rows { margin-top: 24px; }
.ch-rows li { padding: 14px 0; border-top: 1.5px solid currentColor; font-weight: 500; hyphens: auto; }
.ch-rows li:last-child { border-bottom: 1.5px solid currentColor; }

/* Approach */
.ch-steps { display: grid; gap: 28px; counter-reset: none; }
.ch-steps li { position: relative; padding-top: 18px; border-top: 2px solid currentColor; }
.ch-num {
  display: block;
  font-size: clamp(3rem, min(6vw, 10vh), 5.5rem);
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 0.9;
  margin-bottom: 14px;
}
.ch-steps h3 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 6px; }
.ch-steps p { max-width: 30ch; hyphens: auto; }

.ch-small__cols { display: grid; gap: 16px; }
.ch-small__cols p { max-width: 44ch; hyphens: auto; }
.ch-faq .ch-label { padding-bottom: 12px; }
.ch-faq details { border-top: 1.5px solid currentColor; }
.ch-faq details:last-of-type { border-bottom: 1.5px solid currentColor; }
.ch-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.ch-faq summary::-webkit-details-marker { display: none; }
.ch-faq summary::after {
  content: "";
  flex: 0 0 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat;
  box-shadow: inset 0 0 0 1.5px currentColor;
  transition: transform 0.2s;
}
.ch-faq details[open] summary::after { transform: rotate(45deg); }
.ch-faq details p { padding: 0 0 18px; max-width: 52ch; }

/* Products */
.ch-prods { display: grid; gap: 36px; }
.ch-prod { display: flex; flex-direction: column; padding-top: 18px; border-top: 2px solid currentColor; }
.ch-prod h3 { margin: 12px 0 8px; font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 600; letter-spacing: -0.035em; hyphens: auto; }
.ch-prod p { max-width: 40ch; hyphens: auto; }
.ch-prod .ch-meta { margin-bottom: 16px; }
.ch-prod .ch-link { margin-top: auto; }
.ch-meta { margin-top: 10px; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.5; color: rgb(255 255 255 / 0.8); }
.ch-link {
  align-self: flex-start;
  margin-top: 16px;
  padding: 10px 18px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.ch-link:hover { background: #fff; color: var(--violet); }

/* Contact */
.ch-card--ink .ch-run { color: var(--sun); }
.ch-title--contact { color: #fff; }
.ch-contact { display: grid; gap: 18px; }
.ch-contact div { padding-top: 12px; border-top: 1px solid rgb(255 255 255 / 0.3); }
.ch-contact dt { font-family: var(--font-mono); font-size: 0.8125rem; color: rgb(255 255 255 / 0.72); margin-bottom: 4px; }
.ch-contact dd { font-size: 1.125rem; }
.ch-contact a { color: #fff; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.ch-contact a:hover { color: var(--sun); }
.ch-contact__mail dd { font-size: clamp(1.375rem, 2.6vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; }

/* ---------- Footer ---------- */
.ch-foot { background: var(--night); color: #fff; border-top: 1px solid rgb(255 255 255 / 0.14); }
.ch-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 32px;
  max-width: 1360px;
  margin-inline: auto;
  padding: 36px var(--pad-x) 40px;
  font-size: 0.9375rem;
}
.ch-foot__tag { margin-right: auto; }
.ch-foot__brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.ch-foot__tag, .ch-foot__copy { color: rgb(255 255 255 / 0.7); }
.ch-foot__copy { font-family: var(--font-mono); font-size: 0.8125rem; }
.ch-foot__links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.ch-foot a { text-underline-offset: 4px; }
.ch-foot a:hover { color: var(--sun); }

/* ---------- Legal pages ---------- */
.page-imprint main, .page-privacy main { padding: 120px 12px 12px; }
.legal {
  background: #fff;
  border-radius: var(--radius);
  border-top: 14px solid var(--cobalt);
  padding-top: clamp(2.5rem, 6vw, 5rem);
}
.legal h1 { font-weight: 600; letter-spacing: -0.05em; font-size: clamp(2.5rem, 7vw, 5rem); line-height: 0.95; }
.legal h2 { font-weight: 600; letter-spacing: -0.025em; padding-top: 14px; border-top: 1.5px solid var(--night); }
.legal a { text-underline-offset: 3px; }

/* ---------- Grid placement ---------- */
@media (min-width: 700px) {
  .ch-focus__list { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .ch-prods { grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.5vw, 40px); }
  .ch-steps { grid-template-columns: repeat(2, 1fr); }
  .ch-small__cols { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (min-width: 960px) {
  .ch-hero .ch-lead { grid-column: 1 / span 5; }
  .ch-hero .ch-actions { grid-column: 7 / span 3; align-self: end; flex-direction: column; align-items: flex-start; }
  .ch-hero .ch-facts { grid-column: 10 / span 3; align-self: end; }
  .ch-intro { grid-column: 1 / span 4; }
  .ch-dev { grid-column: 6 / span 7; }
  .ch-dev { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(16px, 2vw, 32px); }
  .ch-dev .ch-h3 { grid-column: 1 / -1; }
  .ch-toc { display: flex; }
  .ch-steps { grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 32px); }
  .ch-pair { grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 96px); }
  .ch-pair--small { grid-template-columns: 7fr 5fr; }
  .ch-contact-wrap { display: contents; }
  .ch-card--ink .ch-lead { grid-column: 1 / span 5; align-self: start; }
  .ch-contact { grid-column: 7 / span 6; grid-template-columns: 1fr 1fr; }
  .ch-contact__mail { grid-column: 1 / -1; }
}

/* ---------- The stack: cards stick only where their content fits one screen ---------- */
@media (min-width: 1100px) and (min-height: 740px), (min-width: 960px) and (min-height: 900px) {
  .ch-card { position: sticky; top: 0; }
}
/* The FAQ card grows when answers open: it only sticks with generous room */
@media (max-width: 1339px) and (max-height: 899px), (max-width: 1199px) {
  .ch-card--sun2 { position: relative; }
}

/* Small screens: chapters stay full-colour blocks, gently overlapping */
@media (max-width: 699px) {
  .ch-card { min-height: 0; padding-top: 56px; padding-bottom: 64px; }
  .ch-card:first-child { padding-top: 168px; min-height: 0; }
  .ch-title { font-size: clamp(3rem, 15vw, 5rem); }
  .ch-title--hero { font-size: clamp(2.75rem, 13.5vw, 4.5rem); }
  .ch-title--contact { font-size: clamp(2.5rem, 11.5vw, 4rem); }
  .ch-run span:last-child { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
