/* ==========================================================================
   realonaut.com – Basis und Komponenten
   Setzt tokens.css voraus.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3, h4, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: var(--c-violet); color: var(--c-chalk); }

/* ---------- Fokus: Violett ist das Detail ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Typografie ---------- */
.display, .h-hero, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-tracking);
  line-height: var(--lh-display);
  text-wrap: balance;
  hyphens: manual;
}
.h-hero { font-size: var(--fs-hero); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); line-height: 1.12; }
.h4 {
  font-size: var(--fs-h4);
  font-weight: 650;
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
}
.lead { font-size: var(--fs-lead); line-height: 1.5; max-width: var(--measure); }
.body { max-width: var(--measure); }
.small { font-size: var(--fs-small); }
.caption { font-size: var(--fs-caption); line-height: 1.35; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums; }

/* Fließtext-Links: Obsidian mit Unterstreichung, nie Orange als Textfarbe */
.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--accent);
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.link:hover { text-decoration-color: var(--ink); }

/* ---------- Der Punkt (aus dem Rasterkreis im Logo) ---------- */
.punkt {
  display: inline-block; flex: none;
  width: 0.36em; height: 0.36em; border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.12em;
}
.punkt-list { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.punkt-list li { display: grid; grid-template-columns: 0.9em 1fr; gap: var(--sp-2); align-items: baseline; }
.punkt-list li::before {
  content: ""; width: 0.4em; height: 0.4em; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-0.08em);
}

/* ---------- Halftone als Grafik (statisch, nur Designsystem) ---------- */
.halftone {
  background: var(--accent);
  -webkit-mask: url("../grafik/halftone-schraegstrich.svg") no-repeat center / contain;
          mask: url("../grafik/halftone-schraegstrich.svg") no-repeat center / contain;
  aspect-ratio: 560 / 720;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  --btn-border: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-5);
  border: var(--stroke) solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 600 1rem/1 var(--font-text);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { --btn-bg: var(--accent); --btn-ink: var(--on-accent); --btn-border: var(--accent); }
.btn-primary:hover, .btn-primary.is-hover {
  --btn-bg: var(--accent-hover); --btn-ink: var(--on-accent-hover); --btn-border: var(--accent-hover);
}
.btn-secondary:hover, .btn-secondary.is-hover { --btn-bg: var(--ink); --btn-ink: var(--bg); }
.btn-quiet {
  --btn-border: transparent;
  padding-inline: var(--sp-3);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}
.btn-quiet:hover, .btn-quiet.is-hover { text-decoration-color: var(--ink); }
.btn-sm { min-height: 44px; padding-inline: var(--sp-4); font-size: 0.9375rem; }
.btn.is-focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn.is-active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  --btn-bg: var(--disabled-bg); --btn-ink: var(--disabled-ink); --btn-border: var(--disabled-bg);
  cursor: not-allowed; transform: none;
}
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after {
  content: "";
  width: 1.4em; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, currentColor 0 40%, transparent 40%) 0 0 / 250% 100%;
  animation: busy 900ms linear infinite;
}
@keyframes busy { to { background-position: -150% 0; } }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--tag);
  color: var(--on-tag);
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.tag-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 var(--stroke) var(--ink); }
.tag-ember { background: var(--accent); color: var(--on-accent); }

/* ---------- Flächen & Karten ---------- */
.surface { background: var(--surface); border-radius: var(--r-card); }
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.card-ember { background: var(--accent); color: var(--on-accent); }
.card-ember .muted { color: var(--on-accent); opacity: 0.8; }
.card-inverse { background: var(--inverse); color: var(--on-inverse); }
.card-inverse .muted { color: var(--on-inverse); opacity: 0.72; }
a.card { color: inherit; text-decoration: none; transition: background-color var(--t-base) var(--ease); }
a.card:hover { background: var(--surface-2); }
.rule-dotted { border: 0; border-top: var(--dotted); margin: 0; }

/* ---------- Formulare ---------- */
.field { display: grid; gap: var(--sp-2); }
.field-label { font-size: var(--fs-small); font-weight: 600; }
.field-help { font-size: var(--fs-caption); color: var(--ink-muted); }
.input, .select, .textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--sp-5);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font: 500 1rem/1.4 var(--font-text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea { border-radius: 24px; padding: var(--sp-4) var(--sp-5); min-height: 132px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 26px) 50%, calc(100% - 20px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 48px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.input.is-focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.field.has-error .input, .field.has-error .textarea { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field-error { font-size: var(--fs-small); color: var(--error); font-weight: 600; display: flex; gap: 6px; }
.field.is-valid .input { border-color: var(--success); }
.input:disabled { background: var(--disabled-bg); color: var(--disabled-ink); border-color: var(--disabled-bg); cursor: not-allowed; }

.check { display: grid; grid-template-columns: 24px 1fr; gap: var(--sp-3); align-items: start; font-size: var(--fs-small); cursor: pointer; }
.check input {
  appearance: none; margin: 0; width: 24px; height: 24px;
  border: var(--stroke) solid var(--ink); border-radius: 8px; background: var(--surface);
  display: grid; place-content: center; cursor: pointer;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: ""; width: 7px; height: 12px; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px);
}

/* Terminauswahl (Slot-Pillen) */
.slots { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.slot {
  min-height: 44px; padding: 0 var(--sp-4);
  border: var(--stroke) solid var(--ink); border-radius: var(--r-pill);
  background: transparent; color: var(--ink);
  font: 600 0.9375rem/1 var(--font-text); font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.slot:hover { background: var(--surface-2); }
.slot[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.slot:disabled { border-style: dotted; color: var(--ink-muted); text-decoration: line-through; cursor: not-allowed; background: transparent; }

/* ---------- Navigation ---------- */
.nav {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: 72px;
}
.nav-logo { display: block; width: 208px; flex: none; }
.nav-logo img { width: 100%; }
.nav-pill {
  display: flex; align-items: center; gap: 2px;
  margin-inline: auto;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--r-pill);
}
.nav-pill a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.975rem;
  transition: background-color var(--t-fast) var(--ease);
}
.nav-pill a:hover { background: var(--bg); }
.nav-pill a[aria-current="page"] { background: var(--ink); color: var(--bg); }
/* Ausklappmenü „Leistungen“ */
.nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 var(--sp-4);
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink);
  font: 500 0.975rem/1 var(--font-text); cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.nav-drop-btn::after {
  content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--t-fast) var(--ease);
}
.nav-drop-btn:hover { background: var(--bg); }
.nav-drop-btn.is-current { background: var(--ink); color: var(--bg); }
.nav-drop-btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.nav-drop-panel {
  position: absolute; top: calc(100% + 14px); left: -6px; z-index: var(--z-nav);
  width: 320px; padding: 8px; display: none; gap: 2px;
  background: var(--surface); border-radius: 24px; box-shadow: 0 0 0 var(--stroke) var(--line-soft);
}
.nav-drop-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.nav-drop.is-open .nav-drop-panel { display: grid; }
.nav-pill .nav-drop-panel a {
  display: grid; gap: 2px; min-height: 0; padding: 12px 14px; border-radius: 16px; align-items: start;
}
.nav-drop-panel b { font-weight: 600; }
.nav-drop-panel span { font-size: var(--fs-caption); color: var(--ink-muted); }
.nav-pill .nav-drop-panel a[aria-current="page"] { background: var(--bg); color: var(--ink); }
.nav-tel { color: var(--ink); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nav-burger { display: none; }
.nav-pill a, .nav-drop-btn { white-space: nowrap; }
@media (max-width: 1279px) { .nav-tel { display: none; } }

@media (max-width: 1023px) {
  .nav-pill, .nav-tel { display: none; }
  .nav { justify-content: space-between; min-height: 64px; }
  .nav-logo { width: 176px; }
  .nav .btn-primary { display: none; }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    min-height: 44px; padding: 0 var(--sp-4); border: var(--stroke) solid var(--ink); border-radius: var(--r-pill);
    background: transparent; color: var(--ink); font: 600 0.9375rem/1 var(--font-text); cursor: pointer;
  }
}

/* Fixe Leiste unten, nur Handy */
.mobilebar {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-mobilebar);
  display: none; gap: var(--sp-2);
  padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: var(--dotted);
}
.mobilebar .btn { flex: 1; }
@media (max-width: 767px) { .mobilebar { display: flex; } }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-iteration-count: 1 !important; }
}
