/* familienapp.de — Sales site for the kommunal portal system
   Target A: public marketing site. Tokens live on :root and are
   redefined for dark/high-contrast — there is no host app to inherit from. */

:root {
  --brand: #0f6ba8;
  --brand-strong: #0b4f7d;
  --brand-soft: #e3f1f9;
  --accent: #e8a13a;
  --brand-fg: #ffffff;
  --ink: #1d2733;
  --ink-soft: #445264;
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --bg-card: #ffffff;
  --line: #d9e2ea;
  --ok: #1d7a4f;
  --radius: 14px;
  --radius-sm: 8px;
  --max: 72rem;
  --shadow: 0 10px 30px rgba(15, 43, 68, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6db4e2;
    --brand-strong: #9ccdf0;
    --brand-soft: #12283a;
    --accent: #f0b969;
    --brand-fg: #0e151c;
    --ink: #e8edf2;
    --ink-soft: #b6c3cf;
    --bg: #0e151c;
    --bg-soft: #131e29;
    --bg-card: #16222e;
    --line: #2c3d4d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

@media (prefers-contrast: more) {
  :root {
    --brand: #084a78;
    --brand-fg: #ffffff;
    --ink: #000000;
    --ink-soft: #1d2733;
    --line: #6b7c8d;
  }
}

/* Dark + high-contrast combined: brand surfaces stay light, so fg must stay dark. */
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --brand: #9ccdf0;
    --brand-strong: #cde8fa;
    --brand-fg: #0e151c;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

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

a { color: var(--brand); }
a:hover { color: var(--brand-strong); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-strong);
  color: var(--brand-fg);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; color: var(--brand-fg); }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-block: 0.6rem;
}
.brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand span { color: var(--brand); }
.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.main-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.1rem;
}
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.2rem;
}
.main-nav a:hover { color: var(--brand); }
.lang-switch {
  display: flex;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.lang-switch a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.lang-switch a[aria-current="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-fg);
}

/* ---------- hero ---------- */

.hero {
  background:
    radial-gradient(1200px 520px at 88% -12%, var(--brand-soft), transparent 62%),
    linear-gradient(180deg, var(--bg-soft) 0%, transparent 42%),
    var(--bg);
  border-bottom: 1px solid var(--line);
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero .wrap {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3rem);
}
.hero-text { max-width: 44rem; }
.hero-visual {
  margin: 0;
  position: relative;
}
.hero-visual > .shot { display: block; }
.hero-visual .phone-img {
  position: absolute;
  right: -4%;
  bottom: -8%;
  width: 26%;
}
/* ≥1024px: hero text and product visual side by side, fact strip full width below */
@media (min-width: 1024px) {
  .hero .wrap { grid-template-columns: 1.02fr 0.98fr; align-items: center; }
  .hero .facts { grid-column: 1 / -1; }
}
/* <1024px the visual spans full width: keep the phone inside the viewport edge */
@media (max-width: 1023px) {
  .hero-visual .phone-img { right: 0; width: 26%; }
}
/* ≤560px: slightly larger overlay so it still reads on small screens */
@media (max-width: 560px) {
  .hero-visual .phone-img { bottom: -7%; width: 32%; }
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .sub {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 1.75rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-fg);
}
.btn-primary:hover { background: var(--brand-strong); color: var(--brand-fg); }
.btn-quiet {
  color: var(--brand);
  border-color: var(--line);
  background: transparent;
}
.btn-quiet:hover { border-color: var(--brand); color: var(--brand-strong); }

/* ---------- fact strip ---------- */

.facts {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.4rem;
}
.facts h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
.facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem 2.5rem;
}
/* ≥640px: two aligned columns; ≥1024px: three — items line up as a real grid */
@media (min-width: 640px) { .facts ul { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .facts ul { grid-template-columns: repeat(3, 1fr); } }
.facts li { font-weight: 600; font-size: 0.98rem; }
.facts li b { color: var(--brand); font-weight: 800; }

/* ---------- sections ---------- */

section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
/* keep anchored sections clear of the sticky header (~72px desktop) */
section[id] { scroll-margin-top: 5rem; }
/* ≤640px the header wraps to two rows (~170px) */
@media (max-width: 640px) {
  section[id] { scroll-margin-top: 11rem; }
}
section.alt { background: var(--bg-soft); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }
.section-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.8rem;
}
.section-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }

/* feature grid */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
}
.card p { margin: 0; color: var(--ink-soft); }
.card .icon { font-size: 1.6rem; line-height: 1; margin-bottom: 0.7rem; }

/* ---------- references / screenshots ---------- */

.refs { display: grid; gap: 2.5rem; }
.ref {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
@media (min-width: 880px) {
  .ref { grid-template-columns: 1.15fr 1fr; }
  .ref.flip { grid-template-columns: 1fr 1.15fr; }
  .ref.flip .shot { order: -1; }
}
.shot {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-card);
}
.shot .bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.shot .bar i {
  width: 0.65rem; height: 0.65rem;
  border-radius: 50%;
  background: var(--line);
  display: inline-block;
}
.shot .bar .url {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref h3 { font-size: 1.4rem; margin: 0 0 0.4rem; }
.ref .tagline { font-weight: 700; color: var(--brand); margin: 0 0 0.7rem; }
.ref p { color: var(--ink-soft); margin: 0 0 0.8rem; }
.ref .meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
}
.ref .meta li {
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}
.ref a.more { font-weight: 700; }

/* gallery + phone frames */

.gallery {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}
.gallery figure { margin: 0; }
.gallery figcaption {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.6rem 0.4rem 0;
}
.cms-gallery { margin-top: 2.2rem; }
.cms-note { margin: 1.2rem 0 0; color: var(--ink-soft); font-size: 0.92rem; }

.gallery .phone-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  gap: 1.5rem;
  justify-content: center;
  grid-column: 1 / -1;
}
/* Phone screenshots ship with a real device frame baked into the asset
   (shots/phone-frame.html) — the class only sizes and shadows them. */
.phone-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.30));
}

/* quote */

.quote {
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 1.6rem;
  margin: 0;
}
.quote p { font-size: 1.08rem; margin: 0 0 0.8rem; }
.quote footer { font-size: 0.92rem; color: var(--ink-soft); }
.quote footer b { color: var(--ink); }

/* ---------- process ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.steps li {
  counter-increment: step;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.4rem 4rem;
  position: relative;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.3rem;
  top: 1.35rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-fg);
  font-weight: 800;
  display: grid;
  place-items: center;
}
.steps h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- pricing ---------- */

.price-note {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 760px) { .price-note { grid-template-columns: 1.2fr 1fr; gap: 2.5rem; } }
.price-note h3 { margin-top: 0; }
.price-note ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.price-note li { margin-bottom: 0.4rem; }

/* ---------- FAQ ---------- */

.faq details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.3rem;
  margin-bottom: 0.8rem;
}
.faq summary {
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}
.faq details p { color: var(--ink-soft); margin: 0.7rem 0 0.2rem; }

/* ---------- cross-links ---------- */

.also { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.also a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease;
}
.also a.card:hover { border-color: var(--brand); }
.also .domain { color: var(--brand); font-weight: 700; font-size: 0.9rem; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--brand-strong);
  color: var(--brand-fg);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 3rem);
  text-align: center;
}
.cta-band h2 { margin: 0 0 0.6rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-band p { margin: 0 auto 1.5rem; max-width: 48ch; opacity: 0.92; }
.cta-band .btn-primary { background: var(--bg); color: var(--brand-strong); }
.cta-band .btn-primary:hover { background: var(--accent); color: #1d2733; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 2.5rem 0 2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.site-footer .cols {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
}
.site-footer a { color: var(--ink-soft); }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.legal-note { margin-top: 1.8rem; font-size: 0.85rem; }

/* ---------- legal pages ---------- */

.legal main { max-width: 46rem; }
.legal h1 { font-size: 2rem; margin: 2.5rem 0 1rem; }
.legal h2 { font-size: 1.25rem; margin-top: 2rem; }

@media (max-width: 767px) {
  .main-nav { order: 3; width: 100%; }
  .main-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .facts li { font-size: 0.92rem; }
}

@media (forced-colors: active) {
  .btn-primary, .lang-switch a[aria-current="true"], .steps li::before {
    forced-color-adjust: none;
    background: CanvasText;
    color: Canvas;
  }
  .card, .facts, .shot, .faq details, .price-note { border: 1px solid CanvasText; }
}
