/* ==========================================================================
   RollenPass – Tokens, Reset, Basis, Layout, Komponenten
   Marke: #5c6b1a (Moos/Oliv, oklch H≈120) – kein Firmenlogo vorhanden, daher
   eigene Notfarbe für ein Verwaltungswerkzeug; bewusst abseits der in dieser
   Werkstatt bereits genutzten Teal-/Navy-/Terrakotta-Cluster.
   Schrift: Hanken Grotesk (eine variable Familie, Achsen 400/650/800) – klare,
   freundlich-neutrale Grotesk für ein tägliches SaaS-/Admin-Werkzeug, ohne
   die zuletzt verwendeten Paarungen (IBM Plex, Schibsted Grotesk) zu wiederholen.
   ========================================================================== */

@layer tokens, reset, base, layout, komponenten;

@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  font-synthesis: none;
}

@layer tokens {
  :root {
    --brand: #5c6b1a;
    --h: 119.6;
    --brand-ink-light: oklch(45% 0.105 var(--h));
    --brand-ink-dark: oklch(78% 0.11 var(--h));
    --on-brand: #ffffff;

    --font-display: "Hanken Grotesk", system-ui, sans-serif;
    --font-text: "Hanken Grotesk", system-ui, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, monospace;

    color-scheme: light dark;
    --paper: oklch(98.5% 0.006 var(--h));
    --surface: oklch(99.5% 0.003 var(--h));
    --surface-2: oklch(95% 0.010 var(--h));
    --ink: oklch(18% 0.015 var(--h));
    --text-muted: oklch(46% 0.022 var(--h));
    --line: oklch(88% 0.014 var(--h));
    --line-strong: oklch(60% 0.022 var(--h));
    --brand-ink: light-dark(var(--brand-ink-light), var(--brand-ink-dark));
    --brand-deep: oklch(26% 0.06 var(--h));
    --brand-soft: light-dark(oklch(93% 0.035 var(--h)), oklch(30% 0.045 var(--h)));

    --rot: light-dark(oklch(48% 0.17 27), oklch(74% 0.14 27));
    --gruen: light-dark(oklch(46% 0.11 150), oklch(74% 0.12 150));

    --step--1: clamp(0.875rem, 0.851rem + 0.109vw, 0.9375rem);
    --step-0: clamp(1rem, 0.951rem + 0.217vw, 1.125rem);
    --step-1: clamp(1.2rem, 1.119rem + 0.359vw, 1.41rem);
    --step-2: clamp(1.44rem, 1.316rem + 0.553vw, 1.76rem);
    --step-3: clamp(1.73rem, 1.544rem + 0.816vw, 2.2rem);
    --step-4: clamp(2.07rem, 1.81rem + 1.17vw, 2.75rem);
    --step-5: clamp(2.49rem, 2.119rem + 1.643vw, 3.43rem);
    --step-6: clamp(3.1rem, 2.28rem + 3.7vw, 4.75rem);

    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-s: 1.25rem;
    --space-m: clamp(1.5rem, 1.2rem + 1.3vw, 2rem);
    --space-l: clamp(2.25rem, 1.6rem + 2.8vw, 3.25rem);
    --space-xl: clamp(3.25rem, 2.3rem + 4.2vw, 5.25rem);
    --space-2xl: clamp(5rem, 3.3rem + 7.4vw, 8.5rem);

    --gutter: clamp(1.25rem, 5vw, 6rem);
    --measure: 66ch;
    --content-max: 78rem;

    --radius-s: 3px;
    --radius-m: 6px;

    --shadow-float: 0 1px 2px oklch(25% 0.02 var(--h) / 0.14), 0 8px 24px -12px oklch(25% 0.03 var(--h) / 0.28);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-std: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur-fast: 160ms;
    --dur-base: 220ms;
    --focus-ring: 2px solid var(--brand-ink);
  }

  @supports not (color: light-dark(red, blue)) {
    :root { --brand-ink: var(--brand-ink-light); }
  }
}

/* ---------- Reset -------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; }
  img, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  ul, ol { list-style: none; padding: 0; }
  :target { scroll-margin-block: 6ex; }
}

/* ---------- Basis --------------------------------------------------------- */
@layer base {
  html {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-text);
    font-synthesis: none;
    accent-color: var(--brand-ink);
    caret-color: var(--brand-ink);
    scrollbar-color: var(--line-strong) transparent;
    overflow-x: hidden;
  }
  body { font-size: var(--step-0); line-height: 1.6; overflow-x: hidden; }
  h1, h2, h3 { font-family: var(--font-display); font-weight: 800; text-wrap: balance; color: var(--ink); overflow-wrap: break-word; }
  h1 { font-size: var(--step-6); line-height: 1.02; letter-spacing: -0.02em; max-width: 17ch; }
  h2 { font-size: var(--step-3); line-height: 1.12; letter-spacing: -0.01em; font-weight: 700; }
  h3 { font-size: var(--step-1); line-height: 1.25; font-weight: 700; margin-block-end: var(--space-s); }
  p { max-width: var(--measure); }
  p + p { margin-block-start: var(--space-xs); }
  :lang(de) p { hyphens: auto; }

  a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
  a:hover { text-decoration-thickness: 2px; }
  ::selection { background: var(--brand-soft); color: var(--ink); }
  :focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

  .skip-link {
    position: absolute; inset-inline-start: var(--space-s); inset-block-start: -100px;
    background: var(--paper); padding: var(--space-2xs) var(--space-s); border-radius: var(--radius-s);
    z-index: 100; border: 1px solid var(--line-strong);
  }
  .skip-link:focus { inset-block-start: var(--space-s); }
  .visually-hidden { clip-path: inset(50%); height: 1px; width: 1px; overflow: hidden; position: absolute; white-space: nowrap; }

  .icon { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; flex-shrink: 0; }

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

/* ---------- Layout --------------------------------------------------------*/
@layer layout {
  .kopf {
    border-block-end: 1px solid var(--line);
    background: var(--surface);
    position: sticky; top: 0; z-index: 10;
  }
  .kopf-inner {
    max-width: var(--content-max); margin-inline: auto; padding: var(--space-s) var(--gutter);
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-m);
  }
  .marke {
    font-family: var(--font-display); font-weight: 700; font-size: var(--step-0);
    display: flex; align-items: center; gap: var(--space-2xs); color: var(--brand-ink);
  }
  .link-nav { font-weight: 650; font-size: var(--step--1); }

  .hero {
    max-width: var(--content-max); margin-inline: auto; padding: var(--space-2xl) var(--gutter) var(--space-xl);
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-xl);
    align-items: start;
  }
  .hero-unterzeile { font-size: var(--step-1); color: var(--text-muted); max-width: 42ch; margin-block: var(--space-s) var(--space-m); }
  .hero-text .button { margin-block-start: var(--space-2xs); }

  .hero-beispiel {
    background: var(--brand-deep); color: oklch(97% 0.012 var(--h));
    border-radius: var(--radius-m); padding: var(--space-m);
  }
  .hero-beispiel-titel {
    font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.06em;
    color: oklch(84% 0.03 var(--h)); margin-block-end: var(--space-2xs); font-weight: 600;
  }
  .hero-beispiel-kopf { font-weight: 700; margin-block-end: var(--space-s); color: #fff; }
  .hero-beispiel .checkliste-vorschau li span { color: oklch(94% 0.012 var(--h)); }

  .text-abschnitt {
    max-width: var(--content-max); margin-inline: auto; padding: var(--space-l) var(--gutter);
    border-block-start: 1px solid var(--line);
  }
  .text-abschnitt h2 { margin-block-end: var(--space-s); max-width: 22ch; }
  .text-abschnitt p { margin-block-end: var(--space-xs); }

  .ablauf-liste { display: flex; flex-direction: column; gap: var(--space-s); margin-block-start: var(--space-m); max-width: var(--measure); }
  .ablauf-liste li { display: flex; gap: var(--space-s); align-items: baseline; }
  .ablauf-nr {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600;
    color: var(--brand-ink); flex-shrink: 0; min-inline-size: 1.5ch;
  }

  .werkzeug {
    max-width: var(--content-max); margin-inline: auto; padding: var(--space-xl) var(--gutter) var(--space-2xl);
    border-block-start: 1px solid var(--line);
    display: flex; flex-direction: column; gap: var(--space-l);
  }
  .werkzeug-raster { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-l); align-items: start; }

  .fusszeile {
    border-block-start: 1px solid var(--line); padding: var(--space-m) var(--gutter);
    text-align: center; color: var(--text-muted); font-size: var(--step--1);
  }

  @media (max-width: 62rem) {
    .hero { grid-template-columns: 1fr; }
    .werkzeug-raster { grid-template-columns: 1fr; }
  }
}

/* ---------- Komponenten ----------------------------------------------------*/
@layer komponenten {
  .button {
    display: inline-flex; align-items: center; gap: var(--space-2xs);
    font-weight: 650; font-size: var(--step--1); padding: var(--space-xs) var(--space-s);
    border-radius: var(--radius-s); border: 1px solid transparent; cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-std), border-color var(--dur-fast) var(--ease-std);
    white-space: nowrap;
  }
  .button--primaer { background: var(--brand-ink); color: var(--on-brand); }
  .button--primaer:hover { background: var(--brand-deep); }
  .button--sekundaer { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
  .button--sekundaer:hover { background: var(--surface-2); }
  .button--klein { font-size: var(--step--1); padding: var(--space-2xs) var(--space-xs); }
  .button--gefahr { background: var(--surface); color: var(--rot); border-color: var(--rot); }
  .button--gefahr:hover { background: var(--surface-2); }
  .button:active { transform: translateY(1px); }
  .button:disabled { opacity: 0.5; cursor: not-allowed; }

  .formular-karte, .liste-karte, .checklisten-karte, .sicherung-karte {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
    padding: var(--space-m); display: flex; flex-direction: column; gap: var(--space-s);
    min-width: 0;
  }

  .feld label { display: block; font-size: var(--step--1); font-weight: 650; margin-block-end: var(--space-3xs); }
  .feld input, .feld select, .feld textarea {
    width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-m);
    background: var(--paper); color: var(--ink); padding: var(--space-2xs) var(--space-xs);
    min-block-size: 44px;
  }
  .feld textarea { min-block-size: unset; resize: vertical; }
  .feld input:focus-visible, .feld select:focus-visible, .feld textarea:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
  .formular-aktionen { display: flex; gap: var(--space-xs); margin-block-start: var(--space-2xs); }
  .formular-fehler {
    background: color-mix(in oklch, var(--rot) 12%, var(--surface));
    color: var(--rot); border: 1px solid var(--rot); border-radius: var(--radius-s);
    padding: var(--space-2xs) var(--space-xs); font-size: var(--step--1); font-weight: 600;
  }
  .formular-fehler.ist-erfolg {
    background: color-mix(in oklch, var(--gruen) 12%, var(--surface));
    color: var(--gruen); border-color: var(--gruen);
  }

  .profil-liste { display: flex; flex-direction: column; gap: var(--space-2xs); }
  .profil-zeile {
    display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-s);
    border: 1px solid var(--line); border-radius: var(--radius-m); padding: var(--space-xs) var(--space-s);
  }
  .profil-zeile.wird-bearbeitet { background: var(--brand-soft); }
  .profil-zeile-info { min-width: 0; }
  .profil-zeile-name { font-weight: 700; }
  .profil-zeile-meta { color: var(--text-muted); font-size: var(--step--1); }
  .profil-zeile-aktionen { display: flex; gap: var(--space-2xs); flex-shrink: 0; }

  .checklisten-auswahl { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-s); align-items: end; }
  @media (max-width: 48rem) { .checklisten-auswahl { grid-template-columns: 1fr; } }

  .checkliste-vorschau { display: flex; flex-direction: column; gap: var(--space-xs); }
  .checkliste-vorschau li { display: flex; align-items: flex-start; gap: var(--space-2xs); }
  .checkliste-vorschau li input[type="checkbox"] { margin-block-start: 0.3em; min-block-size: unset; min-inline-size: unset; width: 1.1em; height: 1.1em; flex-shrink: 0; }
  .checkliste-interaktiv li input[type="checkbox"]:checked + span { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }

  .checklisten-kopfzeile { font-family: var(--font-mono); font-weight: 600; color: var(--brand-ink); margin-block-end: var(--space-s); }
  .checklisten-export { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-block-start: var(--space-m); }

  .sicherung-aktionen { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }

  .leerzustand { color: var(--text-muted); padding-block: var(--space-2xs); }
}
