/* Lösungen (loesungen.html) only. Loaded after css/site.css and uses its tokens only
   (no new colours). Sections: #rollen photo cards, the seven problem/solution blocks (.ps)
   grouped by role, #zusammenspiel timeline, #it-datenschutz, #einsatzbereiche. */

/* ================================================================ #rollen: three photo cards
   Reuses .fcard from site.css (index #funktionen), three columns, portrait. */
.fcards--roles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fcards--roles .fcard { min-height: clamp(380px, 34vw, 500px); }
.fcards--roles .fcard-body { padding: clamp(20px, 2.4vw, 36px); }
.fcards--roles .fcard-title { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); hyphens: manual; }
.fcards--roles .fcard-text { font-size: var(--fs-17); }
@media (hover: hover) {
  .fcards--roles .fcard:hover .fcard-arrow { transform: translateY(3px); }
}
@media (max-width: 899px) {
  .fcards--roles { grid-template-columns: minmax(0, 1fr); }
  .fcards--roles .fcard { min-height: 300px; }
}

/* ================================================================ Problem / solution blocks (.ps)
   .ps-problem: the scene on a dark plate (data-theme="dark" in both themes, so it reads as the
   darker side), consequences on the right. .ps-turn: red pill bridging into the solution.
   .ps-solution: light double bezel, steps left, product graphic over the feature photo right. */
/* Group head: hairline on top, headline left, lead right. */
.ps-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: clamp(32px, 5vw, 88px);
  align-items: end;
  max-width: none;
  padding-top: clamp(24px, 2.6vw, 36px);
  border-top: 1px solid var(--line-2);
}
.ps-head .eyebrow { grid-column: 1 / -1; }
.ps-head .lead { margin-top: 0; padding-bottom: 6px; }
@media (max-width: 899px) {
  .ps-head { grid-template-columns: minmax(0, 1fr); }
  .ps-head .lead { margin-top: clamp(16px, 2vw, 24px); padding-bottom: 0; }
}

.ps + .ps { margin-top: clamp(80px, 9vw, 136px); }

.ps-problem {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: clamp(32px, 5vw, 88px);
  row-gap: 32px;
  align-items: start;
  padding: clamp(28px, 4.4vw, 64px) clamp(24px, 4.4vw, 64px) clamp(36px, 4.8vw, 72px);
  overflow: hidden;
  border-radius: var(--r-shell);
  background:
    radial-gradient(60% 90% at 0% 0%, var(--accent-soft), transparent 70%),
    color-mix(in srgb, var(--photo-ink) 55%, var(--bg-2));
  box-shadow: inset 0 1px 0 var(--core-highlight), 0 0 0 1px var(--line), var(--shadow-lg);
}
/* Red marker on the left edge, level with the label. */
.ps-problem::before {
  content: "";
  position: absolute;
  top: clamp(26px, 4.2vw, 62px);
  left: 0;
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-fill);
}

.ps-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.ps-label--problem { color: var(--accent-text); }
.ps-label-feature { color: var(--muted); }
.ps-label-feature::before { content: "/"; margin-right: 12px; color: var(--line-2); }

.ps-scene {
  margin-top: clamp(18px, 2vw, 24px);
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.875rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
}
.ps-when { color: var(--muted); }
.ps-place {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .06em;
  color: var(--muted);
}
.ps-story { max-width: 60ch; margin-top: clamp(18px, 2vw, 24px); font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); }
.ps-note { margin-top: 20px; }

/* Consequences: three short lines with a red warning mark. */
.ps-costs { align-self: end; border-bottom: 1px solid var(--line); }
.ps-costs li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: var(--fs-17);
  line-height: 1.5;
  color: var(--muted);
}
.ps-costs .icon { margin-top: 2px; font-size: 20px; color: var(--accent-text); }
.ps-costs strong { display: block; font-weight: 600; color: var(--text); }

/* Turn: a red pill that bridges the gap between problem and solution. */
.ps-turn { position: relative; z-index: 3; display: flex; justify-content: center; height: 16px; }
.ps-turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  margin-top: -16px;
  padding: 0 6px 0 20px;
  border-radius: var(--r-pill);
  background: var(--accent-fill);
  color: var(--on-accent);
  box-shadow: 0 0 0 6px var(--bg), var(--shadow-lg);
  font-size: var(--fs-14);
  font-weight: 560;
  font-stretch: 110%;
  white-space: nowrap;
}
.ps-turn-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--accent-fill);
  font-size: 18px;
}

/* Solution */
.ps-solution-core {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px;
  padding: 12px;
  background:
    radial-gradient(55% 45% at 0% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.ps-copy { display: flex; flex-direction: column; padding: clamp(24px, 3.2vw, 44px) clamp(16px, 2.4vw, 32px) clamp(20px, 2.4vw, 32px); }
.ps-label--solution { color: var(--text); }
.ps-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 14px;
}
.ps-title { margin-top: clamp(16px, 2vw, 22px); font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.026em; }

/* Steps: a short vertical line with a dot per step, time in mono above the sentence. */
.ps-steps { position: relative; display: grid; gap: 22px; margin-top: clamp(24px, 3vw, 36px); padding-left: 30px; }
.ps-steps::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 1px;
  background: linear-gradient(var(--accent-fill), var(--line-2) 45%, var(--line-2));
}
.ps-steps li { position: relative; }
.ps-steps li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -30px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent-fill);
}
.ps-steps li:first-child::before { background: var(--accent-fill); }
.ps-time {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.ps-steps p { margin-top: 6px; font-size: var(--fs-17); line-height: 1.5; }
.ps-more { margin-top: auto; padding-top: clamp(20px, 2.4vw, 28px); }

/* Visual: the feature photo, dimmed, with the product graphic on top. */
.ps-visual {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: clamp(400px, 40vw, 580px);
  padding: clamp(24px, 4vw, 56px);
  overflow: hidden;
  border-radius: calc(var(--r-core) - 12px);
  background: var(--photo-ink);
}
.ps-visual-img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;
}
.ps-visual--card .ps-visual-img { opacity: .34; }
.ps-gfx { position: relative; width: 100%; }
.ps-gfx--phone { width: min(250px, 64%); }
.ps-gfx--card { width: min(500px, 100%); }
.ps-gfx--screen { width: 100%; }
.ps-gfx::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: -5%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--photo-ink), transparent);
  filter: blur(14px);
  pointer-events: none;
}

/* Motion: the plate rises, the pill pops in after it, consequences and steps cascade (site.js
   [data-reveal] / .is-in). Nothing is hidden without js or under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on .ps-turn[data-reveal] { transform: translate3d(0, 0, 0) scale(.6); transition-duration: .45s; }
  .reveal-on .ps-turn[data-reveal].is-in { transform: none; }
  .reveal-on .ps-solution[data-reveal] { transform: translate3d(0, 28px, 0); transition-duration: .7s; }
  .reveal-on .ps-solution[data-reveal].is-in { transform: none; }
}

.ps-visual--screen { padding: clamp(16px, 2.6vw, 44px); }

@media (max-width: 899px) {
  .ps-problem { grid-template-columns: minmax(0, 1fr); }
  .ps-costs { align-self: auto; }
  .ps-solution-core { grid-template-columns: minmax(0, 1fr); }
  .ps-visual { min-height: 0; }
  .ps-gfx--card { width: min(460px, 100%); }
}
/* Tablet: the consequences side by side under the scene. */
@media (min-width: 600px) and (max-width: 899px) {
  .ps-costs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; border-bottom: 0; }
  .ps-costs li { grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; }
}
@media (max-width: 599px) {
  .ps-problem::before { top: 26px; }
  .ps-label-feature { flex-basis: 100%; }
  .ps-label-feature::before { display: none; }
  .ps-costs li { padding: 14px 0; }
  .ps-story { font-size: var(--fs-17); }
  .ps-turn-pill { box-shadow: 0 0 0 4px var(--bg), var(--shadow-lg); }
  .ps-solution-core { padding: 8px; gap: 8px; }
  .ps-visual { padding: 20px 16px; border-radius: calc(var(--r-core) - 8px); }
  .ps-gfx--phone { width: min(230px, 72%); }
}

/* ================================================================ #zusammenspiel: "Ein Nachtrag, drei Rollen"
   A line with three stations. The line draws (scaleX, on phones scaleY) and the stations rise
   in turn: .relay[data-reveal-stagger] gives the line delay 0 and each station the next step. */
.relay { position: relative; }
.relay-line {
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-fill) 0%, var(--accent-fill) 34%, var(--line-2) 100%);
  transform-origin: left center;
}
.relay-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
}
.relay-step { position: relative; padding-top: clamp(40px, 4.4vw, 56px); }
.relay-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 2px var(--accent-fill);
}
.relay-step:first-child .relay-dot { background: var(--accent-fill); }
.relay-role {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  font-stretch: 100%;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.relay-text { margin-top: 12px; max-width: 34ch; font-size: var(--fs-lead); line-height: 1.5; color: var(--muted); }
.relay-text strong { font-weight: 600; color: var(--text); }
.relay-note { margin-top: clamp(40px, 5vw, 64px); }

@media (prefers-reduced-motion: no-preference) {
  .reveal-on .relay-line[data-reveal] {
    opacity: 1;
    transform: scaleX(0);
    transition: transform 1.1s var(--ease-soft) var(--reveal-delay, 0ms);
  }
  .reveal-on .relay-line[data-reveal].is-in { transform: none; }
  .reveal-on .relay-step .relay-dot { transform: scale(.4); transition: transform .5s var(--ease-spring) var(--reveal-delay, 0ms); }
  .reveal-on .relay-step.is-in .relay-dot { transform: none; }
}

@media (max-width: 767px) {
  .relay-line {
    top: 8px;
    bottom: 8px;
    left: 7px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--accent-fill) 0%, var(--accent-fill) 30%, var(--line-2) 100%);
    transform-origin: center top;
  }
  .relay-steps { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .relay-step { padding-top: 0; padding-left: 40px; }
  .relay-dot { top: 2px; }
  .relay-text { margin-top: 8px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .reveal-on .relay-line[data-reveal] { transform: scaleY(0); }
}

/* ================================================================ #it-datenschutz: heading left, four facts right */
.it-band {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  column-gap: clamp(40px, 6.5vw, 112px);
  row-gap: 40px;
  align-items: center;
}
.it-head .lead { margin-top: clamp(16px, 2vw, 24px); }
.it-head .link-arrow { margin-top: clamp(20px, 2.4vw, 28px); }
.it-facts { border-bottom: 1px solid var(--line); }
.it-facts li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-block: 16px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-17);
  font-weight: 500;
}
@media (max-width: 899px) {
  .it-band { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================ #einsatzbereiche: three columns on hairlines, no cards */
.sectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px clamp(24px, 3.4vw, 56px); }
.sector {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 16px;
  padding-top: clamp(24px, 2.6vw, 32px);
  border-top: 1px solid var(--line-2);
}
.sector .h4 { margin-top: 4px; }
.sector-text { max-width: 38ch; color: var(--muted); }
@media (max-width: 767px) {
  .sectors { grid-template-columns: minmax(0, 1fr); }
}
