/* Invisra Brand CSS v4
   Same identity as v3 — IBM Plex Sans + IBM Plex Mono, single-hue blue, flat
   mono-labeled primary buttons, machined radii, single glow background, and the
   outlined `invisra` wordmark. Corrective release: .invisra-gradient-text no
   longer clips the last glyph under negative letter-spacing, and the lockup
   asset now matches the proportions the CSS lockup renders.
   No classes removed and no custom properties renamed since v3, so v3 -> v4 is
   a URL bump.
   Intended for Invisra Site, Invisra Platform, PartPilot, and future Invisra products.
*/

/* Self-hosted IBM Plex Sans + Mono (latin, latin-ext) — served from this CDN
   under ./fonts/, so loading brand.css triggers no third-party (Google Fonts)
   request. Sans is a variable file shared across weights; Mono is per-weight.
   To refresh or widen coverage, re-run the font vendoring documented in README. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/ibm-plex-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-theme='dark'] {
  color-scheme: dark;

  --invisra-background: #020617;
  --invisra-background-soft: #0f172a;
  --invisra-background-muted: #111827;

  --invisra-surface: #0f172a;
  --invisra-surface-raised: #111c31;
  --invisra-surface-glass: rgba(15, 23, 42, 0.72);

  --invisra-border: rgba(148, 163, 184, 0.22);
  --invisra-border-strong: rgba(148, 163, 184, 0.36);

  --invisra-text: #e5e7eb;
  --invisra-text-muted: #94a3b8;
  --invisra-text-soft: #cbd5e1;
  --invisra-text-inverse: #ffffff;

  --invisra-brand: #60a5fa;
  --invisra-brand-strong: #3b82f6;
  --invisra-brand-soft: rgba(96, 165, 250, 0.16);

  /* v2: accent aliases the brand blue family (indigo removed) */
  --invisra-accent: #60a5fa;
  --invisra-accent-strong: #3b82f6;
  --invisra-accent-soft: rgba(96, 165, 250, 0.16);

  --invisra-success: #34d399;
  --invisra-warning: #fbbf24;
  --invisra-danger: #fb7185;
  --invisra-info: #38bdf8;

  --invisra-shadow-soft: 0 24px 80px rgba(15, 23, 42, 0.48);
  --invisra-shadow-glow: 0 0 60px rgba(96, 165, 250, 0.22);

  /* v2: tighter machined radii */
  --invisra-radius-sm: 0.375rem;
  --invisra-radius-md: 0.5rem;
  --invisra-radius-lg: 0.75rem;
  --invisra-radius-xl: 1rem;

  --invisra-font-sans:
    "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --invisra-font-mono:
    "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme='light'] {
  color-scheme: light;

  --invisra-background: #f8fafc;
  --invisra-background-soft: #eef2ff;
  --invisra-background-muted: #e2e8f0;

  --invisra-surface: #ffffff;
  --invisra-surface-raised: #f8fafc;
  --invisra-surface-glass: rgba(255, 255, 255, 0.78);

  --invisra-border: rgba(15, 23, 42, 0.12);
  --invisra-border-strong: rgba(15, 23, 42, 0.2);

  --invisra-text: #0f172a;
  --invisra-text-muted: #475569;
  --invisra-text-soft: #334155;
  --invisra-text-inverse: #ffffff;

  --invisra-brand: #2563eb;
  --invisra-brand-strong: #1d4ed8;
  --invisra-brand-soft: rgba(37, 99, 235, 0.11);

  --invisra-accent: #2563eb;
  --invisra-accent-strong: #1d4ed8;
  --invisra-accent-soft: rgba(37, 99, 235, 0.11);

  --invisra-success: #059669;
  --invisra-warning: #d97706;
  --invisra-danger: #e11d48;
  --invisra-info: #0284c7;

  --invisra-shadow-soft: 0 24px 80px rgba(15, 23, 42, 0.12);
  --invisra-shadow-glow: 0 0 60px rgba(37, 99, 235, 0.16);
}

.invisra-theme {
  min-height: 100%;
  background:
    radial-gradient(circle at 78% 0%, var(--invisra-brand-soft), transparent 36rem),
    var(--invisra-background);
  color: var(--invisra-text);
  font-family: var(--invisra-font-sans);
}

.invisra-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, var(--invisra-brand-soft), transparent 36rem),
    var(--invisra-background);
  color: var(--invisra-text);
}

.invisra-container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.invisra-header {
  background: var(--invisra-surface-glass);
  border-bottom: 1px solid var(--invisra-border);
  backdrop-filter: blur(16px);
}

.invisra-card,
.invisra-panel {
  background: var(--invisra-surface-glass);
  border: 1px solid var(--invisra-border);
  border-radius: var(--invisra-radius-xl);
  box-shadow: var(--invisra-shadow-soft);
  backdrop-filter: blur(16px);
}

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

.invisra-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.625rem 1rem;
  border-radius: var(--invisra-radius-lg);
  border: 1px solid transparent;
  font-family: var(--invisra-font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.invisra-button:hover {
  transform: translateY(-1px);
}

.invisra-button:active {
  transform: translateY(0);
}

/* v2: flat brand blue, dark text, no gradient */
.invisra-button-primary {
  background: var(--invisra-brand);
  color: var(--invisra-background);
  box-shadow: 0 8px 24px rgba(96, 165, 250, 0.22);
}

.invisra-button-primary:hover {
  background: var(--invisra-brand-strong);
  box-shadow: var(--invisra-shadow-glow);
}

.invisra-button-secondary {
  background: var(--invisra-surface);
  color: var(--invisra-text);
  border-color: var(--invisra-border);
}

.invisra-button-secondary:hover {
  border-color: var(--invisra-border-strong);
  background: var(--invisra-surface-raised);
}

.invisra-button-ghost {
  background: transparent;
  color: var(--invisra-text-muted);
}

.invisra-button-ghost:hover {
  color: var(--invisra-text);
  background: var(--invisra-brand-soft);
}

.invisra-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--invisra-brand-soft);
  color: var(--invisra-brand);
  border: 1px solid rgba(96, 165, 250, 0.24);
  font-family: var(--invisra-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invisra-badge-accent {
  background: var(--invisra-accent-soft);
  color: var(--invisra-accent);
  border-color: rgba(96, 165, 250, 0.24);
}

.invisra-badge-success {
  background: color-mix(in srgb, var(--invisra-success) 14%, transparent);
  color: var(--invisra-success);
  border-color: color-mix(in srgb, var(--invisra-success) 28%, transparent);
}

.invisra-badge-warning {
  background: color-mix(in srgb, var(--invisra-warning) 14%, transparent);
  color: var(--invisra-warning);
  border-color: color-mix(in srgb, var(--invisra-warning) 28%, transparent);
}

.invisra-badge-danger {
  background: color-mix(in srgb, var(--invisra-danger) 14%, transparent);
  color: var(--invisra-danger);
  border-color: color-mix(in srgb, var(--invisra-danger) 28%, transparent);
}

.invisra-input,
.invisra-select,
.invisra-textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--invisra-border);
  border-radius: var(--invisra-radius-md);
  background: var(--invisra-surface);
  color: var(--invisra-text);
  font: inherit;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.invisra-input,
.invisra-select {
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
}

.invisra-textarea {
  min-height: 7rem;
  padding: 0.75rem;
  resize: vertical;
}

.invisra-input::placeholder,
.invisra-textarea::placeholder {
  color: var(--invisra-text-muted);
}

.invisra-input:focus,
.invisra-select:focus,
.invisra-textarea:focus {
  outline: none;
  border-color: var(--invisra-brand);
  box-shadow: 0 0 0 3px var(--invisra-brand-soft);
}

.invisra-text-muted {
  color: var(--invisra-text-muted);
}

.invisra-text-soft {
  color: var(--invisra-text-soft);
}

/* v2: kept for compatibility, now single-hue.
   v4: background-clip: text clips the fill to the inline box, and negative
   letter-spacing pulls that box left of the final glyph's ink — which shaved the
   right edge off the last letter. The padding extends the background box past
   the ink; the matching negative margin cancels it so layout is unchanged. The
   value is generous on purpose: over-padding costs nothing (the background is
   clipped to the glyphs either way) and it covers tracking down to -0.12em. */
.invisra-gradient-text {
  background: linear-gradient(135deg, var(--invisra-brand), var(--invisra-brand-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-inline-end: 0.12em;
  margin-inline-end: -0.12em;
}

.invisra-code {
  font-family: var(--invisra-font-mono);
  color: var(--invisra-text-soft);
}

.invisra-logo-mark {
  display: inline-block;
  width: auto;
  height: 2.5rem;
  color: var(--invisra-brand);
  filter: drop-shadow(0 0 24px rgba(96, 165, 250, 0.22));
}

.invisra-logo-mark-sm {
  height: 1.75rem;
}

.invisra-logo-mark-lg {
  height: 4rem;
}

/* v3: the outlined "invisra" wordmark, masked so it inherits currentColor the
   way .invisra-logo-mark does. The SVG is outlined paths, so nothing here
   depends on a webfont loading.
   Minimum width is 88px — below that the i-dots start to close up. With this
   aspect ratio that is a height floor of 1.446rem, so 1.5rem is the smallest
   safe step and there is no -sm modifier; use the mark alone when you need
   something smaller.
   Leave 0.5 cap heights of clear space on all sides (350 units here, about
   0.46 x the rendered height). Approved fills only: --invisra-text,
   --invisra-text-inverse, or --invisra-brand. Never re-type it in another font,
   never stretch it. */
.invisra-wordmark {
  display: inline-block;
  height: 1.5rem;
  aspect-ratio: 2891.26 / 760.17;
  background-color: currentColor;
  -webkit-mask: url('./invisra-wordmark.svg') no-repeat center / contain;
  mask: url('./invisra-wordmark.svg') no-repeat center / contain;
}

.invisra-wordmark-lg {
  height: 2.5rem;
}

.invisra-logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--invisra-text);
  text-decoration: none;
}

.invisra-logo-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--invisra-font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--invisra-text-muted);
  border: 1px solid var(--invisra-border);
  border-radius: 0.25rem;
  padding: 0.125rem 0.35rem;
}

.invisra-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--invisra-text);
}

.invisra-table th {
  color: var(--invisra-text-muted);
  font-family: var(--invisra-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invisra-table th,
.invisra-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--invisra-border);
}

.invisra-table tbody tr:hover {
  background: var(--invisra-brand-soft);
}

.invisra-focus-ring:focus-visible,
.invisra-button:focus-visible,
.invisra-input:focus-visible,
.invisra-select:focus-visible,
.invisra-textarea:focus-visible {
  outline: 2px solid var(--invisra-brand);
  outline-offset: 2px;
}

.invisra-glow {
  box-shadow: var(--invisra-shadow-glow);
}

.invisra-hairline {
  border-color: var(--invisra-border);
}

.invisra-divider {
  height: 1px;
  background: var(--invisra-border);
  border: 0;
}

.invisra-theme,
.invisra-shell,
.invisra-header,
.invisra-card,
.invisra-panel,
.invisra-button,
.invisra-input,
.invisra-select,
.invisra-textarea {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .invisra-theme,
  .invisra-shell,
  .invisra-header,
  .invisra-card,
  .invisra-panel,
  .invisra-button,
  .invisra-input,
  .invisra-select,
  .invisra-textarea {
    transition-duration: 0.01ms !important;
  }

  .invisra-button:hover {
    transform: none;
  }
}
