/* ============================================
   Linear Theme — Dark-Mode-Native Precision
   Near-black canvas (#08090a) where content emerges from darkness
   like starlight. Achromatic except for a single brand indigo-violet
   (#5e6ad2 / #7170ff). Inter Variable at signature weight 510 with
   aggressive negative tracking at display sizes. Borders are
   semi-transparent white at sub-0.10 opacity — wireframes in moonlight.
   Inspired by linear.app — see public/design-md/linear.app.md
   ============================================ */

:root {
  --color-t-deep: #08090a; /* marketing black */
  --color-t-surface: #0f1011; /* panel dark */
  --color-t-card: #191a1b; /* level 3 */
  --color-t-hover: #28282c; /* secondary */

  --color-t-text: #d0d6e0; /* secondary text — body */
  --color-t-bright: #f7f8f8; /* primary — barely-warm near-white */
  --color-t-muted: #8a8f98; /* tertiary */

  /* Brand indigo-violet — the only chromatic color */
  --color-t-accent: #5e6ad2;
  /* Lightened accent for small text on dark surfaces (F-001: raw accent
     #5e6ad2 fails WCAG AA as text on #08090a/#191a1b at 4.24/3.7:1).
     White-on-accent buttons keep --color-t-accent (4.7:1, passes). */
  --color-t-accent-ink: #9da3ff;
  --color-t-accent-alt: #7170ff;
  --color-t-accent-glow: rgba(94, 106, 210, 0.2);
  --color-t-accent-alt-glow: rgba(113, 112, 255, 0.18);

  --color-t-info: #828fff;
  --color-t-success: #27a644;
  --color-t-warning: #f59e0b;
  --color-t-error: #ef4444;

  --color-t-border: rgba(255, 255, 255, 0.06);
  --color-t-border-active: rgba(113, 112, 255, 0.55);

  /* Inter is bundled. Linear leans on cv01 + ss03 for the geometric alternates. */
  --font-primary:
    "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Variable", Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono:
    "Berkeley Mono", "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas,
    monospace;
  --font-terminal:
    "Berkeley Mono", "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

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

html {
  background-color: var(--color-t-deep);
  color: var(--color-t-text);
  font-family: var(--font-primary);
  font-feature-settings: "cv01", "ss03";
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Display gets aggressive negative tracking — Linear's compressed-engineered feel */
h1,
.font-display {
  font-weight: 510;
  letter-spacing: -0.022em;
  line-height: 1.05;
  color: var(--color-t-bright);
}
h2 {
  font-weight: 510;
  letter-spacing: -0.018em;
  color: var(--color-t-bright);
}
h3 {
  font-weight: 510;
  color: var(--color-t-bright);
}

/* Cards: elevated surface, semi-transparent border, multi-layer inset for depth */
.t-card {
  background: var(--color-t-card);
  border: 1px solid var(--color-t-border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.t-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--color-t-hover);
}

.t-glow {
  box-shadow:
    0 0 0 1px rgba(113, 112, 255, 0.4),
    0 0 24px var(--color-t-accent-alt-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Subtle indigo-violet starlight wash */
.t-bg-pattern {
  background-image:
    radial-gradient(
      ellipse at 20% 0%,
      rgba(94, 106, 210, 0.06) 0%,
      transparent 45%
    ),
    radial-gradient(
      ellipse at 80% 100%,
      rgba(113, 112, 255, 0.04) 0%,
      transparent 45%
    );
}

.t-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-t-hover) 0%,
    var(--color-t-card) 40%,
    var(--color-t-hover) 80%
  );
  background-size: 200% 100%;
  animation: t-shimmer 1.4s ease-in-out infinite;
}
@keyframes t-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.live {
  background: var(--color-t-success);
  box-shadow: 0 0 8px rgba(39, 166, 68, 0.45);
  animation: status-blink 1.6s ease-in-out infinite;
}
.status-dot.idle {
  background: var(--color-t-warning);
}
.status-dot.error {
  background: var(--color-t-error);
}
@keyframes status-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-t-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-t-accent-alt);
}
