/* NoBricks — Basis und Komponenten.
   Eine Datei einbinden, fertig: <link rel="stylesheet" href="/brand/nobricks.css">
   Lädt die selbst gehostete Schrift und die Tokens. Werte nie hart codieren, immer var(--…) nutzen.
   Die Regeln liegen in den Ebenen base und components, damit Tailwind-Klassen sie überschreiben können. */

@import "./fonts/fonts.css";
@import "./tokens.css" layer(base);

@layer base {
  /* ---------- Basis ---------- */
  html {
    color-scheme: dark;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    -webkit-text-size-adjust: 100%;
  }
  [data-theme="light"] { color-scheme: light; }
  [data-theme] { background: var(--surface); color: var(--ink); }
  body {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  img, svg { max-width: 100%; }
  ::selection { background: var(--sage); color: var(--on-sage); }
  :focus-visible { outline: 2px solid var(--sage-text); outline-offset: 3px; }

  /* Große Schriftstufen auf dem Handy verkleinern */
  @media (max-width: 640px) {
    .display { font-size: 44px; line-height: 48px; }
    .h1 { font-size: 32px; line-height: 36px; }
  }
}

@layer components {
  /* ---------- Layout ---------- */
  .nb-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-4);
  }
  .nb-section { padding-block: var(--space-6); }
  @media (min-width: 768px) {
    .nb-container { padding-inline: var(--space-5); }
    .nb-section { padding-block: var(--space-7); }
  }

  /* ---------- Label (wie B2B-HANDEL & ARBITRAGE auf der Karte) ---------- */
  .nb-label {
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
  }
  /* Mit Akzentstrich davor (wie INHABER auf der Karte) */
  .nb-label--strich::before {
    content: "";
    display: inline-block;
    width: 0.875em;
    height: 0.375em;
    margin-right: 0.75em;
    border-radius: 0.125em;
    background: var(--sage);
    vertical-align: 0.2em;
  }

  /* ---------- Mauerband ----------
     Steine im Raster des Logos: 29 × 12 Einheiten, Fuge 4, jede zweite Reihe um 16,5 versetzt.
     Das Logo sitzt als Ausschnitt in der Mauer, mit einer Fuge Luft links und rechts.
     Größe über --u (1 Einheit). Am besten in 0,5-px-Schritten wählen. */
  .nb-mauerband {
    --u: 1.5px;
    --nb-mauer: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2066%2032'%3E%3Crect%20x='0'%20y='0'%20width='29'%20height='12'%20rx='2'/%3E%3Crect%20x='33'%20y='0'%20width='29'%20height='12'%20rx='2'/%3E%3Crect%20x='-16.5'%20y='16'%20width='29'%20height='12'%20rx='2'/%3E%3Crect%20x='16.5'%20y='16'%20width='29'%20height='12'%20rx='2'/%3E%3Crect%20x='49.5'%20y='16'%20width='29'%20height='12'%20rx='2'/%3E%3C/svg%3E");
    position: relative;
    display: flex;
    justify-content: center;
    height: calc(28 * var(--u));
    overflow: hidden;
  }
  @media (min-width: 768px) { .nb-mauerband { --u: 2px; } }
  @media (min-width: 1200px) { .nb-mauerband { --u: 3px; } }
  .nb-mauerband::before,
  .nb-mauerband::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--brick);
    -webkit-mask-image: var(--nb-mauer);
            mask-image: var(--nb-mauer);
    -webkit-mask-size: calc(66 * var(--u)) calc(32 * var(--u));
            mask-size: calc(66 * var(--u)) calc(32 * var(--u));
    -webkit-mask-repeat: repeat-x;
            mask-repeat: repeat-x;
  }
  .nb-mauerband::before {
    left: 0;
    right: calc(50% + 35 * var(--u));
    -webkit-mask-position: right calc(-4 * var(--u)) top 0;
            mask-position: right calc(-4 * var(--u)) top 0;
  }
  .nb-mauerband::after {
    left: calc(50% + 35 * var(--u));
    right: 0;
    -webkit-mask-position: left 0 top 0;
            mask-position: left 0 top 0;
  }
  .nb-mauerband__logo {
    position: relative;
    display: block;
    flex: none;
    width: calc(62 * var(--u));
    height: calc(28 * var(--u));
  }

  /* ---------- Buttons: Steine zum Anklicken ---------- */
  .nb-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: 0 var(--space-4);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font: 600 16px/1 var(--font-sans);
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  /* Primär = gefüllter Stein */
  .nb-btn--primary { background: var(--ink); color: var(--surface); }
  .nb-btn--primary:hover { background: var(--sage); color: var(--on-sage); }
  /* Sekundär = offener Stein */
  .nb-btn--secondary { background: transparent; color: var(--ink); border-color: var(--sage); }
  .nb-btn--secondary:hover { background: var(--sage); color: var(--on-sage); }
  .nb-btn:disabled,
  .nb-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

  /* ---------- Links ---------- */
  .nb-link {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--sage);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.25em;
  }
  .nb-link:hover { color: var(--sage-text); }

  /* ---------- Formular ---------- */
  .nb-field { display: flex; flex-direction: column; gap: var(--space-2); }
  .nb-field__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
  .nb-field__hint { font-size: 14px; line-height: 20px; color: var(--muted); }
  .nb-field__fehler { font-size: 14px; line-height: 20px; color: var(--error); }
  .nb-input {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 12px var(--space-3);
    background: var(--surface-raised);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font: 400 16px/24px var(--font-sans);
  }
  .nb-input::placeholder { color: var(--muted); }
  .nb-input:focus { outline: 2px solid var(--sage-text); outline-offset: 1px; border-color: var(--sage-text); }
  .nb-input[aria-invalid="true"] { border-color: var(--error); }
  textarea.nb-input { min-height: 144px; resize: vertical; }

  /* ---------- Bewegung reduzieren ---------- */
  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
  }
}
