/* ==========================================================================
   Wittwer IT Services – Designsystem (lädt nach tux.css)
   Idee: ruhige, technische Seite. Fläche statt Karten, feine Linien wie
   Schienen im Rack, eine Spalte für den Titel und eine breite für den Inhalt.
   Alle Farben laufen über --theme-* und flippen im Dunkelmodus automatisch.
   ========================================================================== */

:root {
  --theme-bg: #f1f4f2;
  --theme-surface: #f1f4f2;
  --theme-card: #ffffff;
  --theme-text: #13231c;
  --theme-muted: #4f5e57;
  --theme-border: #d1dad5;
  --theme-tint: #e2efe8;          /* helle Primärfläche */
  --accent: #60b18b;
  --accent-ink: #1f6e4b;          /* Primärton für Text auf hellem Grund (AA) */

  --page-max: 118rem;             /* Inhaltsbreite; Flächen laufen darüber hinaus */
  --gutter: clamp(1.25rem, 4.2vw, 5.5rem);
  --section-y: clamp(4rem, 3rem + 5vw, 9rem);
  --measure: 62ch;
  --rail: 1px solid var(--theme-border);
}

html[data-theme='dark'] {
  --theme-bg: #0d1411;
  --theme-surface: #121b17;
  --theme-card: #19241f;
  --theme-text: #eaf2ee;
  --theme-muted: #a3b3ab;
  --theme-border: #2b3a33;
  --theme-tint: #17302434;
  --accent-ink: #7fd0a8;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (min-width: 2200px) { html { font-size: 17.5px; } }   /* nur eine Stufe für sehr grosse Screens */

body { font-feature-settings: 'ss01', 'kern'; text-rendering: optimizeLegibility; }
body, body.bg-\[\#F4F4F4\] { background-color: var(--theme-bg); color: var(--theme-text); }
html[data-theme='light'] .bg-\[\#F4F4F4\] { background-color: var(--theme-surface); }
html[data-theme='light'] .text-\[\#252525\],
html[data-theme='light'] .text-\[\#2C3D51\] { color: var(--theme-text); }
html[data-theme='light'] .text-\[\#5C5C5C\],
html[data-theme='light'] .text-\[\#545454\],
html[data-theme='light'] .text-\[\#515151\] { color: var(--theme-muted); }

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

/* ---------- Tailwind-Container: volle Breite mit Deckel ---------- */
.container { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Schrift ---------- */
.t-display { font-weight: 700; letter-spacing: -.035em; line-height: 1.02; text-wrap: balance; hyphens: manual; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.6rem; border-radius: .5rem; font-weight: 600; font-size: 1rem; line-height: 1.2;
  background: var(--theme-text); color: var(--theme-bg); border: 1px solid var(--theme-text);
  text-decoration: none; transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-quiet { background: transparent; color: var(--theme-text); border-color: var(--theme-border); }
.btn-quiet:hover { background: var(--theme-card); color: var(--theme-text); border-color: var(--theme-text); }

/* ---------- Header ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; }
.site-nav::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-bottom: var(--rail);
  background: color-mix(in srgb, var(--theme-bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
}
.site-nav > .container { padding-block: .6rem; }
.site-nav .nav-logo { height: clamp(3.4rem, 3rem + .6vw, 4.2rem); width: auto; }
.site-nav #navbarContent { background: var(--theme-bg); }
@media (min-width: 1280px) {
  .site-nav #navbarContent, html[data-theme='dark'] .site-nav #navbarContent { background: transparent !important; gap: 2.5rem; }
  .site-nav #navbarContent > ul { align-items: center; gap: 2rem; }
}
.site-nav a:not(.btn), .site-nav button[data-toggle-target] { font-weight: 500; font-size: .98rem; color: var(--theme-text); transition: color .2s; }
.site-nav a:not(.btn):hover, .site-nav button[data-toggle-target]:hover { color: var(--accent-ink); }
.site-nav .nav-cta { font-size: .95rem; padding: .6rem 1.35rem; }
@media (min-width: 1280px) { .site-nav [id^='submenu-'] { border: var(--rail); box-shadow: 0 24px 48px -24px rgb(0 0 0 / .35); border-radius: .75rem; background: var(--theme-card) !important; } }
@media (max-width: 1279px) { .site-nav [id^='submenu-'] { background: transparent !important; border: 0; box-shadow: none; padding-block: .25rem .75rem; } }
.site-nav .theme-toggle-align { transform: none; }
.site-nav .theme-toggle { height: 2.5rem; min-width: 2.5rem; padding: 0 .75rem; border-radius: .5rem; background: transparent; border-color: var(--theme-border); }


/* ---------- Hero (Startseite) ---------- */
.hx { position: relative; overflow: hidden; padding-top: clamp(2.5rem, 1rem + 5vw, 7rem); }
.hx-in { display: grid; gap: clamp(2rem, 4vw, 5rem); align-items: end; }
@media (min-width: 1100px) { .hx-in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.hx-copy { padding-bottom: clamp(2rem, 4vw, 5rem); align-self: center; }
.hx-copy h1 { margin: 0; font-size: clamp(2.5rem, .9rem + 4.1vw, 6.25rem); font-weight: 700; letter-spacing: -.04em; line-height: .98; text-wrap: balance; }
.hx-copy p { margin: clamp(1.25rem, 2vw, 2.25rem) 0 0; max-width: 46ch; font-size: clamp(1.05rem, .95rem + .35vw, 1.4rem); line-height: 1.55; color: var(--theme-muted); }
.hx-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: clamp(1.5rem, 2.5vw, 2.75rem); }
.hx-photo { position: relative; margin: 0; align-self: stretch; display: flex; align-items: flex-end; justify-content: center; min-height: 22rem; }
.hx-photo img { position: relative; width: min(100%, 38rem); height: auto; max-height: 40rem; object-fit: contain; object-position: bottom; }

/* Hinweis-Streifen unter dem Hero */
.hx-strip { border-top: var(--rail); background: var(--theme-bg); }
.hx-strip ul { list-style: none; margin: 0; padding: 0; display: grid; }
@media (min-width: 800px) { .hx-strip ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hx-strip li + li { border-top: var(--rail); }
@media (min-width: 800px) { .hx-strip li + li { border-top: 0; border-left: var(--rail); } }
.hx-strip a, .hx-strip .hx-item { border-radius: .9rem; display: flex; gap: 1.1rem; align-items: center; padding: clamp(1.25rem, 2vw, 2.25rem) clamp(1rem, 2vw, 2.5rem); text-decoration: none; color: inherit; height: 100%; transition: background-color .25s; }
@media (min-width: 800px) { .hx-strip li:first-child > * { padding-left: 0; } }
.hx-strip a:hover { background: var(--theme-card); border-radius: .9rem; }
.hx-strip img { width: 2.6rem; height: 2.6rem; flex: none; }
html[data-theme='dark'] .hx-strip img { filter: invert(1) brightness(1.1); }
.hx-strip h2 { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }
.hx-strip p { margin: .2rem 0 0; font-size: .92rem; color: var(--theme-muted); }

/* Blueprint-Raster hinter Hero und Seitenköpfen */
.hx::before, .ph::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--theme-border) 1px, transparent 1px), linear-gradient(90deg, var(--theme-border) 1px, transparent 1px);
  background-size: 5rem 5rem; background-position: -1px -1px; opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 85% 0%, #000, transparent 70%); mask-image: radial-gradient(ellipse 80% 90% at 85% 0%, #000, transparent 70%);
}
.ph { position: relative; overflow: hidden; }
.hx > *, .ph > * { position: relative; z-index: 1; }

/* ---------- Seitenkopf (Unterseiten) ---------- */
.ph { padding: clamp(3rem, 1rem + 6vw, 8rem) 0 clamp(2.5rem, 2rem + 3vw, 5.5rem); border-bottom: var(--rail); }
.ph-in { display: grid; gap: clamp(1.5rem, 3vw, 3.5rem); }
@media (min-width: 1100px) { .ph-in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(3rem, 6vw, 8rem); align-items: end; } }
.ph h1 { margin: 0; font-size: clamp(2.4rem, .9rem + 4.4vw, 6.5rem); font-weight: 700; letter-spacing: -.04em; line-height: .98; text-wrap: balance; overflow-wrap: anywhere; }
.ph-lead { margin: clamp(1rem, 2vw, 2rem) 0 0; font-size: clamp(1.25rem, 1rem + .9vw, 2rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; color: var(--accent-ink); max-width: 34ch; }
.ph-text { margin: 0; max-width: var(--measure); font-size: clamp(1.05rem, 1rem + .25vw, 1.25rem); line-height: 1.65; color: var(--theme-muted); }
.ph-side { display: grid; gap: 1.25rem; align-content: end; }
.ph-facts { list-style: none; margin: 0; padding: 0; border-top: var(--rail); }
.ph-facts li { display: flex; gap: .8rem; align-items: baseline; padding: .8rem 0; border-bottom: var(--rail); font-weight: 600; }
.ph-facts i { color: var(--accent-ink); width: 1.25rem; flex: none; }
.ph-note { margin: 0; max-width: 40ch; font-size: .88rem; line-height: 1.5; color: var(--theme-muted); }
.ph .tux-wrap { margin: 0; }

/* ---------- Abschnitte-Block (page.html) ---------- */
.blocks { padding: 0; }
.blk { padding: var(--section-y) 0; border-bottom: var(--rail); scroll-margin-top: 4.5rem; }
.blk:last-child { border-bottom: 0; }
.blk-in { display: grid; gap: clamp(1.5rem, 3vw, 4rem); }
@media (min-width: 1200px) { .blk-in { grid-template-columns: minmax(17rem, 25rem) minmax(0, 1fr); column-gap: clamp(3rem, 5vw, 7rem); } }
.blk h2 { margin: 0; font-size: clamp(1.9rem, 1.2rem + 1.7vw, 3.25rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
.blk-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 1.25rem; border-radius: .75rem; background: var(--theme-tint); color: var(--accent-ink); font-size: 1.35rem; }
.blk-pre { margin: .9rem 0 0; font-weight: 600; color: var(--accent-ink); }
.blk-text { margin: 0; max-width: var(--measure); font-size: clamp(1.05rem, 1rem + .25vw, 1.25rem); line-height: 1.65; color: var(--theme-muted); }
.blk-points { list-style: none; margin: clamp(1.5rem, 2.5vw, 2.5rem) 0 0; padding: 0; display: grid; gap: 0 clamp(1.5rem, 3vw, 4rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); border-top: var(--rail); }
.blk-points li { display: flex; gap: .75rem; align-items: baseline; padding: .95rem 0; border-bottom: var(--rail); line-height: 1.45; }
.blk-points i { color: var(--accent-ink); font-size: .8rem; flex: none; }

/* ---------- Call to Action ---------- */
.cta { background: var(--theme-tint); border-top: var(--rail); padding: var(--section-y) 0; }
.cta-in { display: grid; gap: 2rem; align-items: end; }
@media (min-width: 1000px) { .cta-in { grid-template-columns: minmax(0, 1fr) auto; gap: 5rem; } }
.cta h2 { margin: 0; font-size: clamp(2rem, 1rem + 3.4vw, 4.75rem); font-weight: 700; letter-spacing: -.035em; line-height: 1; max-width: 18ch; text-wrap: balance; }
.cta p { margin: 1.25rem 0 0; max-width: 52ch; font-size: clamp(1.05rem, 1rem + .25vw, 1.25rem); line-height: 1.6; color: var(--theme-muted); }

/* ---------- Footer ---------- */
.site-foot { border-top: var(--rail); background: var(--theme-surface); padding: clamp(3rem, 5vw, 6rem) 0 2rem; }
.foot-grid { display: grid; gap: 2.5rem; }
@media (min-width: 800px) { .foot-grid { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 6rem); } }
.foot-brand p { margin: 1.25rem 0 0; max-width: 38ch; line-height: 1.6; color: var(--theme-muted); }
.foot-h { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; }
.foot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.foot-list a { color: var(--theme-muted); text-decoration: none; transition: color .2s; }
.foot-list a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-social { display: flex; gap: .6rem; margin-top: 1.5rem; }
.foot-social a { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .5rem; border: var(--rail); color: var(--theme-text); transition: background-color .2s, color .2s; }
.foot-social a:hover { background: var(--theme-text); color: var(--theme-bg); }
.foot-base { margin-top: clamp(2.5rem, 4vw, 4.5rem); padding-top: 1.5rem; border-top: var(--rail); display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.foot-base img { height: 2.25rem; width: auto; }
.foot-base small { color: var(--theme-muted); font-size: .88rem; }
html[data-theme='dark'] .foot-base img { filter: brightness(1.15); }
.foot-base > a { flex-wrap: wrap; gap: .75rem 1rem; }
.foot-base img { max-width: 100%; }


/* ==========================================================================
   Interaktive Sections (partials/sections/*)
   Jeder Block ist <section> > .x-inner > .x-head + Inhalt. Auf breiten Screens
   steht der Titel links (mitlaufend), der Inhalt rechts und nutzt den Platz.
   Selektoren mit "body section >" schlagen die Inline-Styles der Partials.
   ========================================================================== */
body section > [class$='-inner'] {
  width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter);
}
body section > [class$='-inner'] > :first-child {
  text-align: left; margin: 0 0 clamp(1.5rem, 3vw, 3rem); max-width: 46rem;
}
body section [class$='-head'] h2,
body section .section-head h2 {
  margin: 0 0 1rem; font-size: clamp(1.9rem, 1.2rem + 1.7vw, 3.25rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: break-word; hyphens: manual; text-wrap: balance;
}
@media (min-width: 1200px) { body section:not(.tl):not(.flow):not(.dfx) [class$='-head'] h2 { font-size: clamp(1.75rem, 1rem + 1.35vw, 2.75rem); } }
body section [class$='-head'] p { margin: 0; font-size: clamp(1rem, .95rem + .2vw, 1.15rem); line-height: 1.6; color: var(--theme-muted); }

/* Horizontale Abläufe (Zeitleiste, Automations-Fluss) brauchen die volle Breite: Titel bleibt oben. */
@media (min-width: 1200px) {
  body section:not(.tl):not(.flow):not(.dfx) > [class$='-inner'] {
    display: grid; grid-template-columns: minmax(17rem, 25rem) minmax(0, 1fr);
    column-gap: clamp(3rem, 5vw, 7rem); row-gap: 0; align-content: start;
  }
  body section:not(.tl):not(.flow):not(.dfx) > [class$='-inner'] > * { grid-column: 2; min-width: 0; }
  body section:not(.tl):not(.flow):not(.dfx) > [class$='-inner'] > :first-child {
    grid-column: 1; grid-row: 1 / span 30; align-self: start; position: sticky; top: 6.5rem; margin: 0; max-width: none;
  }
}
@media (min-width: 900px) { body section .tl-steps { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); } }

/* ---------- Kartenraster: Spaltenzahl folgt der Breite ---------- */
body section :is(.sit-grid, .sit-grid.four, .tm-grid, .vl-grid, .crit-grid, .pt-grid) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
body section .sit-grid.two { max-width: none; margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); }
body section .stk-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
body section .jb-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
@media (min-width: 1200px) {
  body section :is(.sit-grid, .tm-grid, .vl-grid, .crit-grid, .pt-grid) { gap: clamp(1.25rem, 1.6vw, 2rem); }
}

/* Migration: Panels dürfen in der schmaleren Inhaltsspalte schrumpfen */
@media (min-width: 900px) { body section .mg-stage { grid-template-columns: minmax(0, 1fr) 5rem minmax(0, 1fr); } }
@media (min-width: 900px) and (max-width: 1799px) { body section .mg-vms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Rollen-Reiter: umbrechen statt überlaufen */
@media (min-width: 720px) { body section .roles-tabs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); } }
body section .roles-tab { min-width: 0; }
body section .mg-steps { justify-content: flex-start; }

/* ---------- Eigene Seiten (Kontakt, Referenzen, Stash, Rechtliches) ---------- */
.ph-solo { align-items: end; }
.grow main h2.text-center, .grow h2.text-center { text-align: left; }
.grow p.text-center.max-w-2xl, .grow p.text-center { text-align: left; margin-left: 0; margin-right: 0; }
.grow .bg-white.rounded-3xl, .grow .bg-primary.rounded-3xl { border-radius: .9rem; }
.grow .bg-white.rounded-3xl { border: var(--rail); box-shadow: none; }
.grow .container.max-w-3xl { max-width: 52rem; margin-inline: 0; }
.grow .container.max-w-4xl { max-width: var(--page-max); }
.grow .flex.justify-center > .w-full { max-width: none; }
.grow .flex.justify-center:has(> .w-full) { justify-content: flex-start; }


/* ---------- Farbverlauf hinter dem Hero-Titel ---------- */
.aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 38vw; height: 38vw; min-width: 18rem; min-height: 18rem; border-radius: 50%; filter: blur(80px); opacity: .32; mix-blend-mode: normal; }
.aurora i:nth-child(1) { background: #60b18b; left: -6%; top: -18%; animation: drift1 22s ease-in-out infinite alternate; }
html[data-theme='dark'] .aurora i { opacity: .22; }
@keyframes drift1 { to { transform: translate(18vw, 14vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .aurora i { animation: none; } }

/* ---------- Scroll-Fortschritt mit kleinem Server ---------- */
.scrollbar { position: fixed; z-index: 70; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
@supports (animation-timeline: scroll()) { .scrollbar { animation: grow linear both; animation-timeline: scroll(root); } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes led { 0%, 100% { opacity: 1; } 8% { opacity: .35; } 14% { opacity: 1; } 55% { opacity: 1; } 58% { opacity: .35; } 62% { opacity: 1; } }
.scroll-srv { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-srv { display: block; position: fixed; z-index: 71; top: 4px; left: 0; width: 1.7rem; height: .62rem; border-radius: .18rem; pointer-events: none;
      background: #16251f; border: 1px solid var(--accent); box-shadow: 0 6px 12px -6px rgb(0 0 0 / .5); animation: srvmove linear both; animation-timeline: scroll(root); }
    .scroll-srv::before { content: ''; position: absolute; left: .22rem; top: 50%; width: .2rem; height: .2rem; margin-top: -.1rem; border-radius: 50%; background: #7fe3b0; box-shadow: .3rem 0 0 #e8b23a; animation: led 1.4s steps(1) infinite; }
  }
}
@keyframes srvmove { to { transform: translateX(calc(100vw - 1.7rem)); } }

@media (max-width: 1099px) {
  .hx-copy { padding-bottom: 0; }
  .hx-photo { min-height: 0; }
  .hx-photo img { max-height: 26rem; }
}
@media (max-width: 1279px) {
  #navbarContent { padding: 6rem 1rem 2rem; overflow-y: auto; justify-content: safe center; }
}

/* Kontrast: weisse Schrift auf Primärgrün erreicht nur 2.4:1; im Hellmodus dunkleres Grün */
html[data-theme='light'] .grow a.bg-primary, html[data-theme='light'] .grow .bg-primary.text-white { background-color: var(--accent-ink); }
