/* ------------------------------------------------------------------
   Arbeit.fit shared system: Warm Professional tokens, motif animation,
   skip link, accessibility panel, language toggle, footer mini-rail,
   and data-a11y attribute selectors.
   Linked from every page, before styles.css / pages.css.
   ------------------------------------------------------------------ */

:root {
  --ink: #141f32;
  --ink-dark: #0e1726;
  --muted: #37475e;
  --dim: #637286;
  --dim-light: #8b97a8;
  --canvas: #fbf9f5;
  --surface: #ffffff;
  --surface-alt: #f4efe6;
  --surface-subtle: #faf7f2;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --night: #fbf9f5;
  --line: #e2dcce;
  --line-strong: #cbc2b1;
  --copper: #c48760;
  --copper-primary: #b96e4b;
  --copper-dark: #955234;
  --copper-light: #e8c6ae;
  --copper-tint: rgba(185, 110, 75, 0.08);
  --navy: #17345f;
  --navy-dark: #102444;
  --navy-light: #edf3fb;
  --steel: #627084;
  --danger: #d32f2f;
  --danger-bg: #fdeeed;
  --success: #1e7e48;
  --success-bg: #eaf7ee;
  --shadow-sm: 0 2px 5px rgba(20, 31, 50, 0.04);
  --shadow: 0 10px 30px rgba(20, 31, 50, 0.06), 0 2px 6px rgba(20, 31, 50, 0.04);
  --shadow-lg: 0 20px 48px rgba(20, 31, 50, 0.1), 0 4px 12px rgba(20, 31, 50, 0.05);
  --font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --content-max: 1320px;
  --gutter: 32px;
  --radius: 14px;
  --radius-sm: 8px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 11px 18px;
  background: var(--navy);
  color: #ffffff;
  font: 600 13px var(--font-body);
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
  transition: top .2s ease;
}
.skip-link:focus { top: 0; outline: 3px solid var(--copper-primary); outline-offset: 2px; }

/* ---------- motif draw system ---------- */
.tool {
  stroke-dasharray: 100;
  animation: tool-draw 9s ease-in-out infinite;
}
.tool use.gh { stroke-dasharray: none; opacity: .18; }
@keyframes tool-draw {
  0% { stroke-dashoffset: 100; }
  38% { stroke-dashoffset: 0; }
  80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -100; }
}
.t1 { animation-delay: .2s; }
.t2 { animation-delay: .8s; }
.t3 { animation-delay: 1.4s; }
.t4 { animation-delay: 2s; }
.t5 { animation-delay: 2.6s; }
.t6 { animation-delay: 3.2s; }

/* ---------- footer mini-rail ---------- */
.footer-rail {
  position: relative;
  width: min(var(--content-max), calc(100% - var(--gutter)));
  height: 52px;
  margin: 20px auto 0;
}
.footer-rail .tool {
  position: absolute;
  top: 8px;
  width: 26px;
  height: 26px;
  color: var(--copper-primary);
}

/* ---------- accessibility panel ---------- */
.a11y-panel {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  justify-content: flex-end;
  background: rgba(14, 23, 38, .45);
  backdrop-filter: blur(6px);
}
.a11y-panel-inner {
  position: relative;
  width: min(420px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 36px 30px 50px;
  box-shadow: var(--shadow-lg);
}
.a11y-panel-inner .kicker {
  margin: 0 0 10px;
  color: var(--copper-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .19em;
}
.a11y-panel-inner h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 26px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.a11y-intro { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.a11y-options { display: grid; gap: 12px; }
.a11y-switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.a11y-switch:hover { border-color: var(--line-strong); background: #ffffff; }
.a11y-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #e6dfd2;
  position: relative;
  transition: background .2s, border-color .2s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s, background .2s;
}
.a11y-switch input:checked + .switch-track { background: var(--copper-primary); border-color: var(--copper-primary); }
.a11y-switch input:checked + .switch-track::after { transform: translateX(18px); background: #ffffff; }
.a11y-switch input:focus-visible + .switch-track { outline: 3px solid rgba(185, 110, 75, .4); outline-offset: 2px; }
.switch-copy { display: grid; gap: 3px; }
.switch-copy b { font-size: 14px; font-weight: 700; color: var(--ink); }
.switch-copy small { font-size: 12px; color: var(--dim); line-height: 1.5; }
.a11y-program {
  margin: 24px 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(185, 110, 75, .35);
  border-radius: 10px;
  background: rgba(185, 110, 75, .08);
  color: #7a3c20;
  font-size: 13px;
  line-height: 1.6;
}
.a11y-program a { color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.a11y-reset {
  margin-top: 6px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--copper-primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  transition: color .18s;
}
.a11y-reset:hover { color: var(--ink); }

/* footer accessibility trigger */
.footer-a11y-open {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s, box-shadow .18s;
}
.footer-a11y-open:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-sm);
}

/* ---------- language toggle ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  transition: color .18s, background .18s;
}
.lang-toggle button + button { border-left: 1px solid var(--line); }
.lang-toggle button:hover { color: var(--ink); background: var(--surface-subtle); }
.lang-toggle button[aria-pressed="true"] { background: var(--copper-primary); color: #ffffff; }

/* header button label swap */
.a11y-short { display: none; }

/* ---------- focus rings ---------- */
:focus-visible { outline: 2px solid var(--copper-primary); outline-offset: 2px; }

/* ---------- data-a11y attribute selectors ---------- */
html[data-a11y~="large-text"] { font-size: 112.5%; }
html[data-a11y~="high-contrast"] {
  --ink: #000000;
  --muted: #1a273a;
  --dim: #33445e;
  --line: #b5aba0;
  --line-strong: #7d7265;
  --canvas: #f6f2e8;
  --surface: #ffffff;
  --surface-alt: #ece5d6;
}
html[data-a11y~="high-contrast"] :focus-visible { outline-width: 3px; outline-offset: 3px; }
html[data-a11y~="underline-links"] a:not(.primary-button):not(.secondary-button):not(.job-link):not(.skip-link):not(.header-cta) {
  text-decoration: underline;
}

/* reduced motion: OS preference and explicit toggle share the same rules */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .tool, .hero-underline path { stroke-dasharray: none !important; animation: none !important; }
  .ticker span { animation: none !important; }
}
html[data-a11y~="reduced-motion"] *, html[data-a11y~="reduced-motion"] *::before, html[data-a11y~="reduced-motion"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
html[data-a11y~="reduced-motion"] .tool, html[data-a11y~="reduced-motion"] .hero-underline path {
  stroke-dasharray: none !important;
  animation: none !important;
}
html[data-a11y~="reduced-motion"] .ticker span { animation: none !important; }

@media (max-width: 760px) {
  .a11y-long { display: none; }
  .a11y-short { display: inline; }
}
