/* ClinicalStudio
   Trust-first editorial system for German ambulatory operations.
   Off-white, graphite and one cobalt accent.
   Shape rule: 8px controls, 16px content surfaces. */

:root {
  --paper: #f8f9fb;
  --paper-raised: #fcfcfd;
  --surface: #eef1f5;
  --surface-strong: #e6eaf0;
  --ink: #11151d;
  --ink-mid: #505969;
  --ink-soft: #747e8f;
  --rule: #dce1e8;
  --accent: #2346d8;
  --accent-deep: #1835ad;
  --accent-soft: #e9edff;
  --band: #131823;
  --band-text: #f2f4f8;
  --band-muted: #b4bdcb;

  --shell: 1180px;
  --shell-narrow: 820px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-space: clamp(4.75rem, 9vw, 8rem);
  --radius: 16px;
  --radius-control: 8px;
  --shadow-soft: 0 22px 60px rgb(31 50 91 / 9%);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11151c;
    --paper-raised: #171c25;
    --surface: #1b212b;
    --surface-strong: #242b37;
    --ink: #f0f2f6;
    --ink-mid: #b5bdca;
    --ink-soft: #8f99a9;
    --rule: #303744;
    --accent: #718bff;
    --accent-deep: #94a7ff;
    --accent-soft: #202a4f;
    --band: #090c12;
    --band-text: #f3f5f8;
    --band-muted: #aab4c4;
    --shadow-soft: 0 24px 64px rgb(2 6 15 / 28%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 610;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow {
  max-width: var(--shell-narrow);
}

.skiplink {
  position: fixed;
  top: 0.75rem;
  left: -9999px;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.875rem;
}

.skiplink:focus {
  left: 0.75rem;
}

/* Wordmark */

.mark {
  display: inline-block;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
  text-decoration: none;
  text-transform: uppercase;
}

.mark__line {
  display: block;
}

.mark:hover {
  color: var(--accent);
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 88%, transparent);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.nav__inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 1.25rem;
}

.nav__links {
  display: flex;
  margin-left: auto;
  gap: 1.75rem;
  color: var(--ink-mid);
  font-size: 0.875rem;
}

.nav__links a,
.foot__links a {
  text-decoration: none;
}

.nav__links a:hover,
.foot__links a:hover {
  color: var(--ink);
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-mid);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.language-switcher a {
  text-decoration: none;
}

.language-switcher a:hover,
.language-switcher [aria-current="page"] {
  color: var(--ink);
}

.language-switcher__divider {
  color: var(--ink-soft);
  font-weight: 400;
}

/* Buttons and links */

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--sm {
  min-height: 38px;
  padding: 0.6rem 0.95rem;
  font-size: 0.8125rem;
}

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid:hover {
  background: var(--accent-deep);
  color: #f7f8fb;
}

.btn--invert {
  background: var(--band-text);
  color: var(--band);
}

.btn--invert:hover {
  background: var(--accent);
  color: #f7f8fb;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-mid);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.15rem;
  margin-top: 2rem;
}

/* Type */

.h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 6vw, 4.65rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

/* German compounds need a little more room in the split hero. */
html[lang="de"] .hero .h1 {
  max-width: 17ch;
  font-size: clamp(2.6rem, 4.6vw, 3.8rem);
  hyphens: none;
  overflow-wrap: normal;
}

html[lang="de"] .hero .h1__keyword {
  white-space: nowrap;
}

.h2 {
  max-width: 19ch;
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -0.045em;
}

.h2--large {
  max-width: 17ch;
  font-size: clamp(2.45rem, 5.2vw, 4.25rem);
  line-height: 1.01;
}

.h2--on-dark {
  color: var(--band-text);
}

.eyebrow {
  margin-bottom: 1.5rem;
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__lede,
.section-lede {
  color: var(--ink-mid);
  font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
  line-height: 1.55;
}

.hero__lede {
  max-width: 34rem;
  margin-top: 1.5rem;
}

.section-lede {
  max-width: 39rem;
  margin-top: 1.35rem;
}

.section-lede--on-dark {
  color: var(--band-muted);
}

/* Hero */

.hero {
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.hero__grid {
  position: relative;
  display: grid;
  min-height: calc(100dvh - 68px);
  grid-template-columns: minmax(0, 0.86fr) minmax(31rem, 1.14fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero__copy {
  width: 100%;
  padding-block: clamp(4rem, 8vw, 6.5rem);
}

.hero__visual {
  display: flex;
  min-height: clamp(25rem, 38vw, 30rem);
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 48%, var(--paper-raised)), var(--paper-raised) 68%);
  box-shadow: var(--shadow-soft);
}

.flow {
  width: 100%;
}

.flow__head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-left: 9.25rem;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: center;
}

.flow__head span:first-child {
  text-align: left;
}

.flow__head span:last-child {
  text-align: right;
}

.flow__lanes {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  margin-top: 2.5rem;
}

.flow__lane {
  --lane-delay: 0s;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
}

.flow__lane:nth-child(2) {
  --lane-delay: -2.4s;
}

.flow__lane:nth-child(3) {
  --lane-delay: -4.8s;
}

.flow__name {
  color: var(--ink-mid);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
}

.flow__track {
  position: relative;
  height: 1.5rem;
}

.flow__track::before,
.flow__progress {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-50%);
  content: "";
}

.flow__track::before {
  background: var(--rule);
}

.flow__progress {
  background: var(--accent);
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  animation: flow-progress 7.2s cubic-bezier(0.45, 0, 0.2, 1) infinite;
  animation-delay: var(--lane-delay);
}

.flow__node {
  position: absolute;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--rule);
  border-radius: 50%;
  background: var(--paper-raised);
  transform: translate(-50%, -50%);
  animation-duration: 7.2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-delay: var(--lane-delay);
}

.flow__node--signal {
  left: 0;
  animation-name: flow-node-signal;
}

.flow__node--context {
  left: 33.333%;
  animation-name: flow-node-context;
}

.flow__node--action {
  left: 66.666%;
  animation-name: flow-node-action;
}

.flow__node--verified {
  right: 0;
  left: auto;
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  transform: translate(50%, -50%);
  animation-name: flow-node-verified;
}

.flow__node--verified::after {
  color: #f7f8fb;
  content: "✓";
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  animation: flow-check 7.2s linear infinite;
  animation-delay: var(--lane-delay);
}

@keyframes flow-progress {
  0%, 6% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0);
  }
  9% {
    opacity: 1;
  }
  68%, 86% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
  }
  96%, 100% {
    opacity: 0;
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes flow-node-signal {
  0%, 6%, 96%, 100% {
    border-color: var(--rule);
    background: var(--paper-raised);
  }
  9%, 86% {
    border-color: var(--accent);
    background: var(--accent);
  }
}

@keyframes flow-node-context {
  0%, 25%, 96%, 100% {
    border-color: var(--rule);
    background: var(--paper-raised);
  }
  28%, 86% {
    border-color: var(--accent);
    background: var(--accent);
  }
}

@keyframes flow-node-action {
  0%, 45%, 96%, 100% {
    border-color: var(--rule);
    background: var(--paper-raised);
  }
  48%, 86% {
    border-color: var(--accent);
    background: var(--accent);
  }
}

@keyframes flow-node-verified {
  0%, 65%, 96%, 100% {
    border-color: var(--rule);
    background: var(--paper-raised);
  }
  68%, 86% {
    border-color: var(--accent);
    background: var(--accent);
  }
}

@keyframes flow-check {
  0%, 67%, 90%, 100% {
    opacity: 0;
    transform: scale(0.7);
  }
  70%, 86% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Sections */

.section {
  padding-block: var(--section-space);
}

.section--tint {
  background: var(--surface);
}

.section-head {
  margin-bottom: clamp(3rem, 6vw, 4.75rem);
}

.section-head--compact {
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.problem {
  background: var(--paper-raised);
}

.problem .section-lede {
  max-width: 37rem;
}

.problem__statement {
  max-width: 16ch;
  margin-top: clamp(3.25rem, 7vw, 5.5rem);
  padding-left: clamp(1.25rem, 3vw, 2rem);
  border-left: 4px solid var(--accent);
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 610;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

/* Case execution model */

.execution {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}

.execution__item {
  position: relative;
  min-height: 15rem;
  padding: 1.5rem 1.5rem 1.75rem;
  border-left: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper-raised) 72%, transparent);
}

.execution__item:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.execution__item:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.execution__item::after {
  position: absolute;
  top: 1.25rem;
  right: -0.7rem;
  z-index: 2;
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--accent-deep);
  content: "→";
  font-size: 0.75rem;
}

.execution__item:last-child::after {
  display: none;
}

.execution__verb {
  display: block;
  margin-bottom: 4.5rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.execution__item p {
  color: var(--ink-mid);
  font-size: 0.875rem;
  line-height: 1.5;
}

.execution__item--complete {
  background: var(--accent);
}

.execution__item--complete .execution__verb,
.execution__item--complete p {
  color: #f7f8fb;
}

/* Use cases */

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.use-case {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.use-case h3 {
  max-width: 18ch;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
}

.use-case__examples {
  max-width: 35rem;
  margin-top: 1rem;
  color: var(--ink-mid);
  line-height: 1.55;
}

.use-case__done {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--rule) 82%, transparent);
  color: var(--ink-mid);
  font-size: 0.875rem;
  line-height: 1.5;
}

.use-case__done strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.use-case--requests,
.use-case--revenue {
  grid-column: span 5;
}

.use-case--referrals,
.use-case--procedures {
  grid-column: span 7;
}

.use-case--follow-up {
  grid-column: 1 / -1;
  min-height: 15rem;
}

.use-case--referrals,
.use-case--procedures {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--rule));
}

.use-case--follow-up {
  background: var(--paper-raised);
}

.use-case--follow-up .use-case__done {
  max-width: 36rem;
}

/* Approach */

.approach__intro {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.principle {
  min-height: 12rem;
  padding: 1.75rem 2rem 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.principle:nth-child(even) {
  padding-right: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--rule);
}

.principle h3 {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

.principle p {
  max-width: 31rem;
  color: var(--ink-mid);
  font-size: 0.9375rem;
}

/* Foundation and close */

.foundation {
  background: var(--paper-raised);
}

.foundation .h2 {
  max-width: 24ch;
}

.band {
  background: var(--band);
}

.close {
  display: flex;
  min-height: 22rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.close .h2 {
  max-width: 18ch;
}

.close .btn {
  margin-top: 2rem;
}

/* Footer */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding-block: 2.25rem;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--ink-mid);
  font-size: 0.875rem;
}

.foot__legal {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

/* Legal pages */

.nav--simple .language-switcher {
  margin-left: auto;
}

.legal {
  min-height: calc(100vh - 160px);
}

.legal__head {
  max-width: 42rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.legal__head .section-lede {
  margin-top: 1rem;
}

.legal__content {
  max-width: 45rem;
}

.legal__section {
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.legal__section h2 {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

.legal__section p,
.legal__section li {
  color: var(--ink-mid);
}

.legal__section p + p {
  margin-top: 0.75rem;
}

.legal__section ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.legal__section a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}

/* Tablet */

@media (max-width: 920px) {
  .hero__grid {
    display: grid;
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: clamp(3.5rem, 8vw, 5.5rem);
    padding-bottom: clamp(2rem, 6vw, 4rem);
  }

  .hero__copy {
    width: 100%;
    padding-block: 0 clamp(3rem, 8vw, 5rem);
  }

  .hero__visual {
    width: 100%;
    min-height: 21rem;
  }

  .execution {
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--rule);
  }

  .execution__item {
    min-height: 12rem;
    border: 0;
    border-radius: 0;
  }

  .execution__item:first-child,
  .execution__item:last-child {
    border-radius: 0;
  }

  .execution__item::after {
    display: none;
  }

  .execution__verb {
    margin-bottom: 3rem;
  }

  .execution__item--complete {
    grid-column: 1 / -1;
  }

  .use-case--requests,
  .use-case--revenue,
  .use-case--referrals,
  .use-case--procedures {
    grid-column: span 6;
  }
}

/* Mobile */

@media (max-width: 720px) {
  .nav__links {
    display: none;
  }

  .language-switcher {
    margin-left: auto;
  }

  .section {
    padding-block: clamp(4rem, 16vw, 5.5rem);
  }

  .h1 {
    max-width: 12ch;
    font-size: clamp(2.75rem, 13vw, 4rem);
  }

  .hero__visual {
    min-height: 19rem;
  }

  .flow__head {
    margin-left: 7.5rem;
    font-size: 0.625rem;
  }

  .flow__lane {
    grid-template-columns: 6.25rem minmax(0, 1fr);
    gap: 1.25rem;
  }

  .execution {
    grid-template-columns: 1fr;
  }

  .execution__item,
  .execution__item--complete {
    min-height: auto;
    grid-column: auto;
  }

  .execution__verb {
    margin-bottom: 2.25rem;
  }

  .use-case-grid {
    grid-template-columns: 1fr;
  }

  .use-case--requests,
  .use-case--revenue,
  .use-case--referrals,
  .use-case--procedures,
  .use-case--follow-up {
    grid-column: auto;
  }

  .use-case {
    min-height: 17rem;
  }

  .principles {
    grid-template-columns: 1fr;
  }

  .principle,
  .principle:nth-child(even) {
    min-height: auto;
    padding: 1.5rem 0 1.75rem;
    border-left: 0;
  }

  .close {
    min-height: 20rem;
  }

  .foot__inner {
    align-items: flex-start;
  }

  .foot__links {
    width: 100%;
    order: 3;
  }

  .foot__legal {
    margin-left: auto;
  }
}

@media (max-width: 430px) {
  .nav__inner {
    min-height: 64px;
    gap: 0.75rem;
  }

  .nav__inner > .btn {
    min-height: 36px;
    padding-inline: 0.75rem;
    font-size: 0.75rem;
  }

  .actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }

  .hero__visual {
    min-height: 18rem;
    padding: 1.25rem;
  }

  .flow__head {
    margin-left: 5.5rem;
    font-size: 0.5rem;
    letter-spacing: 0.02em;
  }

  .flow__lanes {
    gap: 1.75rem;
    margin-top: 2rem;
  }

  .flow__lane {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .flow__name {
    font-size: 0.6875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .text-link {
    transition: none;
  }

  .flow__progress {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
    animation: none;
  }

  .flow__node {
    border-color: var(--accent);
    background: var(--accent);
    animation: none;
  }

  .flow__node--verified::after {
    opacity: 1;
    transform: scale(1);
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .nav {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
