/* =========================================================================
   Schachtacht - shared design system: fixed instrument-panel frame

   Not a scrolling marketing page. A fixed frame (top bar / left channel
   rail / bottom bar) stays on screen; the main viewport swaps content per
   page and scrolls internally when content overflows - so nothing clips
   like the old single-viewport app-shell did, but it still reads as a
   panel/instrument, not an infinite-scroll landing page. Every screen is
   built as content (left, flexible) + band (right, fixed width, dense
   stacked facts/lists) - "content in band form", carried over from the
   original site's packed two-column menu instead of the wide-open
   whitespace of a typical marketing page.
   ========================================================================= */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --surface: #131313;
  --surface-strong: #1a1a1a;
  --border: #2a2a2a;
  --border-strong: #3d3d3d;

  --text: #f0efec;
  --text-muted: #a3a09a;
  --text-dim: #6b6862;

  --accent: #622237;
  --accent-strong: #84344f;
  --accent-ink: #f6e8ec;
  --accent-rgb: 98, 34, 55;

  --success: #7cc47f;
  --error: #e8604a;
  --error-rgb: 232, 96, 74;

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --space-3xs: clamp(4px, 0.6vw, 6px);
  --space-2xs: clamp(6px, 1vw, 10px);
  --space-xs: clamp(10px, 1.6vw, 16px);
  --space-sm: clamp(16px, 2.4vw, 24px);
  --space-md: clamp(24px, 3.6vw, 40px);
  --space-lg: clamp(36px, 5.5vw, 72px);
  --space-xl: clamp(56px, 8vw, 120px);

  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 4px;

  --top-h: 56px;
  --rail-w: 64px;
  --bottom-h: 34px;
  --band-w: 240px;
}

/* -------- RESET -------- */
* { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
}

/* iOS Safari ignores `overflow: hidden` on <body> for the purposes of the
   page itself rubber-banding/bouncing - the standard fix is to take body
   out of document flow entirely (position: fixed, pinned to the viewport)
   rather than rely on overflow alone. Combined with overscroll-behavior
   below, this is what actually stops the whole frame from being draggable
   on iOS instead of just the intended internal-scroll regions. */
body {
  position: fixed;
  inset: 0;
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* -------- TYPE -------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.4rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
}

p {
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 var(--space-sm);
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  max-width: 56ch;
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-xs);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex-shrink: 0; }

/* =========================================================================
   FRAME
   ========================================================================= */
.frame {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: var(--top-h) 1fr var(--bottom-h);
  grid-template-areas:
    "top top"
    "rail main"
    "bottom bottom";
}

/* corner registration marks - print-production reference marks, purely
   decorative but on-theme for a company that reads spec sheets for fun */
.reg { position: fixed; width: 14px; height: 14px; z-index: 200; pointer-events: none; opacity: 0.55; }
.reg::before, .reg::after { content: ""; position: absolute; background: var(--text-dim); }
.reg::before { width: 14px; height: 1px; top: 6px; left: 0; }
.reg::after { width: 1px; height: 14px; top: 0; left: 6px; }
.reg.tl { top: 8px; left: 8px; }
.reg.tr { top: 8px; right: 8px; }
.reg.bl { bottom: 8px; left: 8px; }
.reg.br { bottom: 8px; right: 8px; }

/* -------- TOP BAR -------- */
.top {
  grid-area: top;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  min-width: 0;
}
.top .mark {
  height: var(--top-h);
  width: var(--rail-w);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.top .mark img { height: 22px; width: auto; }
.top .wordmark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-left: 18px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top .wordmark b { color: var(--text); font-weight: 600; }
.top .ref {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-align: right;
  line-height: 1.5;
  flex-shrink: 0;
  white-space: nowrap;
}

/* -------- LEFT RAIL (channel nav) -------- */
.rail {
  grid-area: rail;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.rail a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.rail a span.label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rail a .n { color: var(--text-dim); font-size: 0.62rem; }
.rail a:hover { color: var(--text); background: var(--bg-elevated); }
.rail a.active { color: var(--accent-ink); background: var(--accent); }
.rail a.active .n { color: rgba(20, 8, 0, 0.55); }
.rail a:last-child { border-bottom: none; }

/* -------- BOTTOM BAR -------- */
.bottom {
  grid-area: bottom;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}
.bottom a { color: var(--text-dim); text-decoration: none; }
.bottom a:hover { color: var(--accent); }
.bottom .dot { width: 6px; height: 6px; background: var(--accent); display: inline-block; margin-right: 8px; vertical-align: middle; }

/* -------- MAIN + SCREEN -------- */
.main {
  grid-area: main;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
}

.screen {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr var(--band-w);
}

.screen-content { min-width: 0; }

/* -------- BAND (right-hand dense info column) -------- */
.band {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.band-group { border-bottom: 1px solid var(--border); padding: 18px; }
.band-group:last-child { border-bottom: none; }

.band-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.band-facts { display: flex; flex-direction: column; }
.band-facts .row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}
.band-facts .k { color: var(--text-dim); white-space: nowrap; }
.band-facts .leader { flex: 1 1 auto; border-bottom: 1px dotted var(--border-strong); margin-bottom: 3px; }
.band-facts .v { color: var(--text); white-space: nowrap; text-align: right; }

.band-list { display: flex; flex-direction: column; }
.band-list a, .band-list .item {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.band-list a:last-child, .band-list .item:last-child { border-bottom: none; }
.band-list a:hover { color: var(--accent); }
.band-list a.active { color: var(--accent); }

.band-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.55;
}

@media (max-width: 900px) {
  :root { --band-w: 100%; }
  .screen { grid-template-columns: 1fr; }
  .band { border-left: none; border-top: 1px solid var(--border); }
}

/* -------- MOBILE FRAME COLLAPSE -------- */
@media (max-width: 720px) {
  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: var(--top-h) 44px 1fr var(--bottom-h);
    grid-template-areas:
      "top"
      "rail"
      "main"
      "bottom";
  }
  .rail {
    flex-direction: row;
    align-items: center;
    height: 44px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    /* iOS: constrain the drag gesture to horizontal only and stop it from
       handing off to the page (the "settles in the middle like it's
       floating" symptom - the page behind it was catching part of the
       gesture and rubber-banding). Paired with the body position:fixed
       fix above. */
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    /* Hide the scrollbar/thumb indicator - this is a fixed nav bar, not a
       document, it shouldn't look like a scrollable list. */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail a {
    flex: 0 0 auto;
    height: 100%;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 0 16px;
    min-width: max-content;
  }
  .rail a span.label {
    writing-mode: horizontal-tb;
    transform: none;
  }
  .top .ref { display: none; }
}

/* =========================================================================
   COMPONENTS (used inside .screen-content across pages)
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-ink); color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: var(--surface-strong); }
.btn-sm { padding: 9px 16px; font-size: 0.78rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.field-row { display: flex; gap: var(--space-xs); }
.field-row > .field { flex: 1 1 0; min-width: 0; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }

.form-status { font-family: var(--font-mono); font-size: 0.82rem; min-height: 1.2em; }
.form-status.ok { color: var(--success); }
.form-status.error { color: var(--error); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.chip:hover { color: var(--text); border-color: var(--text-muted); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.empty-state {
  padding: var(--space-lg) 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: center;
}

/* Catalog index cards, not e-commerce product tiles: a stamped item
   number instead of a quiet grid position, the price as a hard-outlined
   flat sticker (the same device as the homepage hero tag) instead of
   quiet grey text, an unedited photo, and a slight alternating tilt per
   card so a page of them reads like items pinned to a board rather than
   a machine-perfect grid. */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-md) var(--space-sm); }

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.product-card:hover { border-color: var(--accent); }
.product-card.tilt-1 { transform: rotate(-0.6deg); }
.product-card.tilt-2 { transform: rotate(0.5deg); }
.product-card.tilt-0 { transform: rotate(-0.35deg); }

.product-card-media { position: relative; }

.product-card-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-elevated); display: block; }
.product-card-image-placeholder {
  width: 100%; aspect-ratio: 4 / 3; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
}

/* A quiet echo of the product-detail "exhibit" ghost typography, not the
   hard-outlined sticker it replaces: an oversized outlined numeral bleeding
   past the photo's corner, no fill, no shadow, no rotation of its own. */
.product-card-ghost-index {
  position: absolute;
  right: -4px;
  bottom: -20px;
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-strong);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.product-card-price {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-card-body {
  padding: var(--space-sm);
  padding-top: 0;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  border-top: 1px solid var(--border);
}
.product-card-category { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-top: var(--space-2xs); }
.product-card-name { font-family: var(--font-display); text-transform: uppercase; font-size: 1.05rem; font-weight: 400; line-height: 1.15; }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* A literal lowercase path readout instead of the "Home / Produkte"
   breadcrumb-widget convention every site ships - segments run together
   like a URL, not a spaced list with a UI-pattern feel. Only the
   ancestors are links; the current page renders as plain text, same as
   a real path never links its own last segment. */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: var(--space-sm);
  word-break: break-word;
}
.breadcrumb a { text-decoration: none; color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .sep { color: var(--border-strong); }

/* -------- SPEC TABLE -------- */
.spec-table { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.spec-table li {
  display: flex; align-items: baseline; gap: var(--space-2xs); padding: 10px 0;
  border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.86rem;
}
.spec-table .spec-label { color: var(--text-dim); white-space: nowrap; }
.spec-table .spec-leader { flex: 1 1 auto; border-bottom: 1px dotted var(--border-strong); margin-bottom: 4px; }
.spec-table .spec-value { color: var(--text); white-space: nowrap; }

/* -------- INDEX LIST (table-of-contents rows, not card grids) -------- */
.index-list { display: flex; flex-direction: column; }
.index-list .row {
  display: flex; align-items: baseline; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.index-list .row:first-child { padding-top: 0; }
.index-list .row .num { font-family: var(--font-mono); color: var(--accent); font-size: 0.78rem; flex-shrink: 0; width: 22px; }
.index-list .row h3 { flex-shrink: 0; margin: 0; font-size: 1.2rem; }
.index-list .row p { font-size: 0.86rem; color: var(--text-muted); flex: 1; margin: 0; }
.index-list .row .go { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); flex-shrink: 0; margin-left: auto; }
.index-list a.row:hover .go { color: var(--accent); }
.index-list a.row:hover h3 { color: var(--accent); }

@media (max-width: 640px) {
  .index-list .row { flex-wrap: wrap; gap: 6px 24px; }
  .index-list .row h3 { width: auto; }
  .index-list .row p { flex: 1 1 100%; }
}
