/* ORMA – Gestaltung.
   Abgeleitet aus der Formensprache von ORNA (Grundfarben, Schriften, feine Linien), aber eigenständig:
   eigene Datei, eigene Klassen (orma-…), keine Abhängigkeit von styles.css oder rad.css.
   Einziger Akzent ist die vorhandene Akzentfarbe der Website (--accent). */

:root {
  --bg: #f8f8f6;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665e;
  --border: #e4e0d8;
  --line: #cfcac0;
  --accent: #c2410c;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --touch: 52px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #211f1c;
    --text: #ece8e1;
    --muted: #a39d93;
    --border: #34312c;
    --line: #4a463f;
    --accent: #f08a5d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }        /* auch bei Knöpfen mit eigener Anzeige */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Kopf ---------- */
.orma-top {
  max-width: 40rem;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px 0;
}
.orma-home {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 4px 8px 4px 0;
  border: 0; background: none; color: var(--text);
  font: 600 0.9rem/1 var(--font); letter-spacing: 0.22em;
  cursor: pointer;
}
.orma-logo { width: 38px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.orma-logo-dot { fill: var(--accent); stroke: none; }

/* ---------- Ansicht ---------- */
.orma-view {
  max-width: 40rem;
  margin: 0 auto;
  padding: 16px 16px max(40px, env(safe-area-inset-bottom));
  outline: none;
}
.orma-view h1, .orma-view h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0.4em 0 0.5em;
  outline: none;
}
.orma-view h1 { font-size: clamp(2.6rem, 11vw, 3.6rem); letter-spacing: 0.12em; }
.orma-view h2 { font-size: clamp(1.6rem, 6.5vw, 2.1rem); }
.orma-kicker {
  margin: 0; color: var(--accent);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.orma-sub { margin: -0.3em 0 1.2em; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.15rem; }
.orma-claim { font-size: 1.2rem; line-height: 1.45; margin: 0 0 2rem; }
.orma-muted { color: var(--muted); }
.orma-small { font-size: 0.875rem; color: var(--muted); }
.orma-note {
  margin: 1rem 0; padding: 12px 14px;
  border: 1px solid var(--accent); border-radius: 10px;
  font-size: 0.95rem;
}

/* ---------- Knöpfe: grosse Touch-Flächen ---------- */
.orma-actions { display: flex; flex-direction: column; gap: 12px; margin: 1.6rem 0; }
.orma-actions--row { flex-direction: row; flex-wrap: wrap; }
.orma-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 12px 22px;
  border: 1px solid var(--text); border-radius: 999px;
  background: none; color: var(--text);
  font: inherit; font-size: 1rem; letter-spacing: 0.02em; text-align: center; text-decoration: none;
  cursor: pointer;
}
.orma-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.orma-btn--primary { background: var(--text); color: var(--bg); }
.orma-btn--primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.orma-btn--quiet { border-color: var(--line); color: var(--muted); }
.orma-btn--danger { border-color: var(--accent); color: var(--accent); }
.orma-btn[disabled] { opacity: 0.45; cursor: default; }
.orma-link {
  min-height: 44px; padding: 8px 0; border: 0; background: none;
  color: var(--text); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
/* Zusätze der Startansicht (Runde verwerfen, Installieren, Hinweise): untereinander, nie in einer Zeile */
.orma-extra { display: flex; flex-direction: column; align-items: flex-start; }
.orma-extra > p { margin: 0 0 8px; }

/* ---------- Formularfelder ---------- */
.orma-field { display: block; margin: 1rem 0; }
.orma-field > span { display: block; margin-bottom: 6px; font-size: 0.95rem; }
.orma-input, .orma-text {
  width: 100%; min-height: var(--touch);
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.0625rem;                     /* ≥ 16 px: kein Zoom beim Tippen (iOS) */
}
.orma-text { min-height: 9rem; resize: vertical; line-height: 1.5; }
.orma-input:focus, .orma-text:focus { border-color: var(--text); outline: none; }

/* ---------- Rad ---------- */
.orma-wheel-wrap { position: relative; margin: 0.5rem auto 0; max-width: 28rem; }
.orma-wheel {
  display: block; width: 100%; aspect-ratio: 1;
  touch-action: none; user-select: none; -webkit-user-select: none;
  color: var(--text); cursor: grab;
}
.orma-wheel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 50%; }
.orma-wheel.is-spinning { cursor: default; }
.orma-ring { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.orma-ring--thin { stroke-width: 0.8; opacity: 0.55; }
.orma-tick { stroke: currentColor; stroke-width: 0.8; opacity: 0.5; vector-effect: non-scaling-stroke; }
.orma-axis { stroke: var(--accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.orma-mark { fill: var(--accent); }
.orma-cross { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.orma-sym { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.orma-sym * { vector-effect: non-scaling-stroke; }
.orma-sym .sym-line { stroke-width: 1.3; }
.orma-sym .sym-ghost { opacity: 0.45; }
.orma-sym .sym-over { stroke-width: 0.9; }
.orma-sym .sym-dot { fill: currentColor; stroke: none; }
.orma-pair {
  margin: 1rem 0 0; min-height: 3.2em;
  font-family: var(--serif); font-size: clamp(1.4rem, 6vw, 1.8rem); line-height: 1.2; text-align: center;
}
.orma-pair .orma-x { color: var(--accent); padding: 0 0.2em; }
.orma-view > .orma-pair { min-height: 0; margin: 0.2rem 0 1.2rem; text-align: left; }   /* ausserhalb des Rads: ohne Platzhalter */

/* ---------- Lesen, Wahl ---------- */
.orma-label {
  display: block; margin: 1.6rem 0 0.35rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.orma-question { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; margin: 0; }
.orma-origin { margin-top: 1.4rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.orma-origin summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.orma-origin summary::-webkit-details-marker { display: none; }
.orma-origin summary::before { content: "+"; width: 1.4em; color: var(--accent); font-size: 1.2em; }
.orma-origin[open] summary::before { content: "−"; }
.orma-origin p { margin: 0.4rem 0 0.8rem; }
.orma-choice { display: flex; flex-direction: column; gap: 12px; margin: 1.2rem 0; }
.orma-option {
  display: block; width: 100%; text-align: left;
  min-height: var(--touch); padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.orma-option:hover { border-color: var(--text); }
.orma-option strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; margin-bottom: 4px; }
.orma-option span { display: block; font-size: 0.975rem; }
.orma-task {
  margin: 0.4rem 0 1rem; padding: 14px 16px;
  border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0;
}
.orma-task p { margin: 0.2rem 0 0; }

/* ---------- Übergabe ---------- */
.orma-handover { text-align: center; padding: 12vh 0 0; }
.orma-handover .orma-logo { width: 96px; height: 60px; stroke-width: 1.2; color: var(--muted); }

/* ---------- Antworten ---------- */
.orma-answers { display: grid; gap: 14px; margin: 1rem 0; }
@media (min-width: 40rem) { .orma-answers--two { grid-template-columns: 1fr 1fr; } }
.orma-answer {
  margin: 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.orma-answer h3 { margin: 0 0 0.4rem; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.orma-answer p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.orma-answer .orma-oral { font-style: italic; color: var(--muted); }
.orma-prompt { font-family: var(--serif); font-size: 1.3rem; margin: 1.4rem 0 0.4rem; }
.orma-radio { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 0; cursor: pointer; }
.orma-radio input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--text); flex: none; }

/* ---------- Ergebniskarte (Ansicht) ---------- */
.orma-result {
  margin: 1rem 0; padding: 24px 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.orma-result .orma-pair { text-align: left; margin: 0.4rem 0 0.8rem; min-height: 0; }
.orma-result p { white-space: pre-wrap; overflow-wrap: anywhere; }
.orma-preview { display: block; width: 100%; height: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; background: #f8f8f6; }
.orma-check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; }
.orma-check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--text); flex: none; }

/* ---------- Gedankenbuch ---------- */
.orma-book { list-style: none; margin: 1rem 0; padding: 0; border-top: 1px solid var(--border); }
.orma-book li { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.orma-entry {
  flex: 1; display: block; min-height: 64px; padding: 12px 4px; text-align: left;
  border: 0; background: none; color: var(--text); font: inherit; cursor: pointer;
}
.orma-entry strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.1rem; }
.orma-loops .orma-entry { cursor: default; }                    /* offene Schleife: nicht zu öffnen */
.orma-entry span { font-size: 0.875rem; color: var(--muted); }
.orma-fav {
  width: var(--touch); flex: none; border: 0; background: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer;
}
.orma-fav[aria-pressed="true"] { color: var(--accent); }
.orma-danger-zone { margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.orma-help ol { padding-left: 1.3em; }
.orma-help li { margin: 0.35rem 0; }
.orma-foot { margin-top: 3rem; font-size: 0.8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- Startbild (js/intro.js): wie ORNA, vertikal geteilt, rechte Hälfte invers (REGELN §14) ---------- */
.orma-intro-open { overflow: hidden; }
/* bis das Startbild steht: leere Fläche statt eines kurzen Blicks auf die Startansicht */
.oi-pre body > :not(.orma-intro) { visibility: hidden; }
.oi-pre body { background: #f8f8f6; }

.orma-intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
  background: #f8f8f6;                /* feste Farben: links immer schwarz auf weiss, auch im Dunkelmodus */
  color: #1f1d1a;
  transition: opacity 0.55s ease;
  cursor: pointer;
}
.orma-intro.is-leaving { opacity: 0; pointer-events: none; }
/* rechte Hälfte: alles darunter umkehren – weiss auf schwarz */
.oi-invert {
  position: absolute;
  inset: 0 0 0 50%;
  -webkit-backdrop-filter: invert(1);
  backdrop-filter: invert(1);
  pointer-events: none;
}

.oi-wheel { width: min(78vw, 58vh, 460px); height: auto; overflow: visible; }
.oi-wheel path,
.oi-wheel circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.oi-wheel .sym-line { stroke-width: 1.3; }
.oi-wheel .sym-ghost { opacity: 0.45; }
.oi-wheel .sym-over { stroke-width: 0.9; }
.oi-wheel .sym-dot { fill: currentColor; stroke: none; }
.oi-ring { stroke-width: 1.4; }
.oi-ring--thin { stroke-width: 0.8; opacity: 0.6; }

.oi-sym {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.6);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s ease;
  transition-delay: calc(0.15s + var(--i) * 0.03s);
}
.oi-wheel .oi-mark { fill: currentColor; stroke: none; opacity: 0; transition: opacity 0.4s ease 2.1s; }
.oi-wheel .oi-cross { stroke-width: 1; opacity: 0; transition: opacity 0.4s ease 2.1s; }
.oi-name {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  letter-spacing: 0.6em;
  padding-left: 0.6em;                /* optisch zentriert trotz Sperrung */
  opacity: 0;
  transition: opacity 0.6s ease 2.2s;
}
.orma-intro.is-assembling .oi-sym { opacity: 1; transform: none; }
.orma-intro.is-assembling .oi-wheel .oi-mark,
.orma-intro.is-assembling .oi-wheel .oi-cross,
.orma-intro.is-assembling .oi-name { opacity: 1; }
