/* ==========================================================================
   AUTOHAUS SENKAN — base.css
   Design tokens, reset, typography and shared UI primitives.
   Every other stylesheet builds on these variables and classes.
   ========================================================================== */

@import url('fonts.css');

:root {
  /* Surfaces */
  --bg: #060607;
  --bg-2: #0b0b0d;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #212125;
  --line: rgba(237, 233, 227, 0.09);
  --line-strong: rgba(237, 233, 227, 0.2);

  /* Text */
  --text: #ede9e3;
  --text-dim: rgba(237, 233, 227, 0.64);
  --text-faint: rgba(237, 233, 227, 0.4);

  /* Brand — bronze is sampled from the Senkan logo (#AA8E6B) */
  --bronze: #aa8e6b;
  --bronze-hi: #dcc39c;
  --bronze-lo: #6e5940;
  --bronze-glow: rgba(214, 186, 145, 0.35);
  --bronze-grad: linear-gradient(120deg, #f0dcb8 0%, #c4a073 30%, #8a6c4b 55%, #d9bf96 80%, #a8865f 100%);
  --on-bronze: #120e09;

  /* States */
  --danger: #ff6b5e;
  --warn: #f2b84b;
  --ok: #7ad6a2;

  /* Type */
  --font-display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --font-logo: 'Josefin Sans', 'Archivo', sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: clamp(1.125rem, 0.6vw + 1rem, 1.375rem);
  --fs-xl: clamp(1.5rem, 1.6vw + 1rem, 2.25rem);
  --fs-2xl: clamp(2rem, 3.4vw + 1rem, 4rem);
  --fs-3xl: clamp(2.75rem, 6vw + 1rem, 7.5rem);
  --fs-mega: clamp(3.5rem, 13vw, 15rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur: 420ms;
  --dur-slow: 900ms;

  /* Layout */
  --gutter: clamp(16px, 4vw, 64px);
  --maxw: 1440px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --nav-h: 76px;

  /* Layers */
  --z-webgl: 0;
  --z-content: 2;
  --z-hud: 40;
  --z-nav: 50;
  --z-modal: 80;
  --z-cursor: 90;
  --z-preloader: 100;

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--bronze); color: var(--on-bronze); }

:focus-visible {
  outline: 2px solid var(--bronze-hi);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: 16px; z-index: 200;
  padding: 12px 18px; border-radius: var(--radius-pill);
  background: var(--bronze); color: var(--on-bronze); font-weight: 700;
  transform: translateY(-150%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: none; }

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

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.015em;
}
.display--condensed { font-stretch: 72%; letter-spacing: -0.01em; }
.h-mega { font-size: var(--fs-mega); }
.h-3xl { font-size: var(--fs-3xl); }
.h-2xl { font-size: var(--fs-2xl); }
.h-xl { font-size: var(--fs-xl); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.75em;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-hi);
}
.eyebrow::before {
  content: ''; width: 28px; height: 1px; background: currentColor; opacity: 0.7;
}
.eyebrow--plain::before { display: none; }

.lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--text-dim); max-width: 46ch; }
.muted { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.text-bronze {
  background: var(--bronze-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.text-outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 56px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: var(--btn-h);
  padding: 0 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn__icon {
  display: inline-grid; place-items: center;
  width: 1.15em; height: 1.15em;
  transition: transform var(--dur) var(--ease-out);
}
.btn:hover .btn__icon { transform: translateX(4px); }
.btn:hover .btn__icon--diag { transform: translate(3px, -3px); }

.btn--primary {
  color: var(--on-bronze);
  background: var(--bronze-grad);
  background-size: 200% 100%;
  background-position: 0% 0;
  box-shadow: 0 0 0 1px rgba(255, 233, 196, 0.25) inset, 0 10px 40px -10px var(--bronze-glow);
  transition: background-position var(--dur-slow) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn--primary:hover {
  background-position: 100% 0;
  box-shadow: 0 0 0 1px rgba(255, 233, 196, 0.4) inset, 0 16px 60px -12px rgba(214, 186, 145, 0.6);
}

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(17, 17, 19, 0.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn--ghost::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--text);
  transform: translateY(101%);
  border-radius: inherit;
  transition: transform var(--dur) var(--ease-out);
}
.btn--ghost:hover { color: var(--bg); border-color: var(--text); }
.btn--ghost:hover::before { transform: translateY(0); }

.btn--lg { --btn-h: 68px; padding: 0 38px; font-size: 0.875rem; }
.btn--sm { --btn-h: 42px; padding: 0 18px; font-size: 0.6875rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.icon-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.link-underline {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--dur) var(--ease-out);
}
.link-underline:hover { background-size: 100% 1px; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(17, 17, 19, 0.5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.badge--bronze { color: var(--bronze-hi); border-color: rgba(170, 142, 107, 0.45); }

/* ---------- Form primitives (shared by Verkaufen, Finanzierung, Händler) ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field__label .req { color: var(--bronze-hi); margin-left: 2px; }
.field__hint { font-size: var(--fs-xs); color: var(--text-faint); }
.field__error {
  font-size: var(--fs-xs); color: var(--danger);
  display: none;
}
.field.is-invalid .field__error { display: block; }

.input, .select, .textarea {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(237, 233, 227, 0.32); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--bronze);
  background: rgba(170, 142, 107, 0.06);
  box-shadow: 0 0 0 4px rgba(170, 142, 107, 0.16);
}
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 94, 0.12);
}
.select {
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23dcc39c' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
.select option { background: var(--surface-2); color: var(--text); }

/* Chip radio / checkbox group:
   <div class="chips" role="radiogroup"><label class="chip"><input type="radio" name="x" value="a"><span>A</span></label></div> */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9375rem;
  color: var(--text-dim);
  transition: all var(--dur-fast) ease;
  user-select: none;
}
.chip:hover span { border-color: rgba(237, 233, 227, 0.4); color: var(--text); }
.chip input:checked + span {
  color: var(--on-bronze);
  border-color: transparent;
  background: var(--bronze-grad);
  box-shadow: 0 6px 24px -8px var(--bronze-glow);
}
.chip input:focus-visible + span { outline: 2px solid var(--bronze-hi); outline-offset: 3px; }

/* Switch: <label class="switch"><input type="checkbox"><span class="switch__track"></span><span>Text</span></label> */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; flex: none;
  width: 48px; height: 28px; border-radius: 99px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  transition: background var(--dur) var(--ease-out);
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text);
  transition: transform var(--dur) var(--ease-snap);
}
.switch input:checked + .switch__track { background: var(--bronze); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: var(--on-bronze); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--bronze-hi); outline-offset: 3px; }

/* Checkbox: <label class="check"><input type="checkbox"><span class="check__box"></span><span>Text</span></label> */
.check { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; line-height: 1.45; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 22px; margin-top: 1px;
  border-radius: 6px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--dur-fast) ease;
}
.check__box::after {
  content: ''; width: 10px; height: 6px;
  border-left: 2px solid var(--on-bronze); border-bottom: 2px solid var(--on-bronze);
  transform: rotate(-45deg) scale(0); margin-top: -2px;
  transition: transform var(--dur) var(--ease-snap);
}
.check input:checked + .check__box { background: var(--bronze); border-color: var(--bronze); }
.check input:checked + .check__box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--bronze-hi); outline-offset: 3px; }

/* Range slider */
.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer;
  --fill: 50%;
}
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bronze-hi) 0 var(--fill), var(--surface-3) var(--fill) 100%);
}
.range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--bronze-hi); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: var(--text); border: 4px solid var(--bronze);
  box-shadow: 0 0 0 6px rgba(170, 142, 107, 0.18);
}
.range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); border: 4px solid var(--bronze);
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(170, 142, 107, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--surface);
}
.card--glass {
  background: rgba(17, 17, 19, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
