/* RajaSystems — design system */
:root {
  --bg: #000000;
  --bg-elevated: #141418;
  --surface: #1a1a1f;
  --text: #e8e6e3;
  --text-muted: #8c8a87;
  --accent: #c9a227;
  --accent-rgb: 201, 162, 39;
  --accent-hover: #e0c04a;
  --accent-soft: rgba(var(--accent-rgb), 0.15);
  --accent-border: rgba(var(--accent-rgb), 0.25);
  --accent-glow: rgba(var(--accent-rgb), 0.08);
  --border: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --radius: 14px;
  --font-head: "Syne", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --nav-link-gap: 1.75rem;
  --nav-link-size: 0.9375rem;
  --bar-padding: 1.25rem 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* WebGL shader background canvas */
.shader-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: -2;
}

/* Fallback particle layer (non-home pages) */
.bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  pointer-events: none;
  z-index: -2;
  display: none;
}

.bg-particles {
  display: block;
}

.bg-particles canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero .lead,
  .hero-cta {
    animation: none;
  }
  .card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .card:hover {
    transform: none;
  }
  .liquid-btn:hover {
    transform: none;
  }
}


a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.logo:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 960px) {
  .container {
    max-width: 800px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1.25rem;
  }
}

@media (max-width: 380px) {
  .container {
    padding: 0 1rem;
  }
}

.container--narrow {
  max-width: 420px;
}

/* Header + footer — shared bar layout */
.site-header {
  padding: var(--bar-padding);
  border: 1px solid var(--border);
  border-top: none;
  border-left: none;
  border-right: none;
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@supports not (backdrop-filter: blur(12px)) {
  .site-header {
    background: rgba(12, 12, 14, 0.95);
  }
}

.site-footer {
  margin-top: auto;
  padding: 0.35rem 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-left: none;
  border-right: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo,
.hero h1,
.page-title {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo {
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  color: var(--accent);
}

.logo-mark path {
  fill: currentColor;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.page-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}

.logo:hover {
  color: var(--text);
  opacity: 0.9;
}

/* Nav + footer links — shared layout and type */
.nav,
.footer-links {
  display: flex;
  gap: var(--nav-link-gap);
}

.nav a,
.footer-links a {
  color: var(--text-muted);
  font-size: var(--nav-link-size);
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav a::after,
.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after,
.footer-links a:hover::after,
.footer-links a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav a:hover,
.nav a[aria-current="page"],
.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 540px) {
  .header-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .site-header {
    padding: 1rem 0;
  }
  .logo {
    font-size: 1.2rem;
  }
  .nav,
  .footer-links {
    gap: 1.25rem;
  }
  .nav a,
  .footer-links a {
    font-size: 0.875rem;
  }
}

/* Main content */
main {
  flex: 1;
  padding: 4.5rem 0 5.5rem;
}

@media (max-width: 640px) {
  main {
    padding: 3rem 0 4rem;
  }
}

@media (max-width: 380px) {
  main {
    padding: 2.5rem 0 3.5rem;
  }
}

.hero {
  margin-bottom: 3.5rem;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  animation: hero-enter 0.55s ease-out both;
}

.hero .lead {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  max-width: 32ch;
  animation: hero-enter 0.55s ease-out 0.15s both;
}

.hero-cta {
  margin-top: 2rem;
  animation: hero-enter 0.55s ease-out 0.3s both;
}

/* Liquid glass button */
.liquid-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.75rem;
  border-radius: 9999px;
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

.liquid-btn:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.liquid-btn:active {
  transform: translateY(0) scale(0.99);
}

.liquid-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* Hidden SVG filter definition */
.liquid-btn-filter {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Frosted glass interior — the liquid distortion */
.liquid-btn-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(201, 162, 39, 0.06);
  backdrop-filter: url("#liquid-glass") blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    inset  2px  2px 1px -2px rgba(255, 255, 255, 0.18),
    inset -2px -2px 1px -2px rgba(0, 0, 0, 0.5),
    inset  0    0   8px  4px rgba(0, 0, 0, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.liquid-btn:hover .liquid-btn-glass {
  background: rgba(201, 162, 39, 0.12);
  box-shadow:
    inset  2px  2px 1px -2px rgba(255, 255, 255, 0.22),
    inset -2px -2px 1px -2px rgba(0, 0, 0, 0.5),
    inset  0    0   8px  4px rgba(0, 0, 0, 0.08),
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 0 12px rgba(201, 162, 39, 0.12);
}

.liquid-btn-text {
  position: relative;
  z-index: 1;
}

.about-intro {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 55ch;
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (max-width: 380px) {
  .card {
    padding: 1.25rem 1.5rem;
  }
  .card h3 {
    font-size: 1rem;
  }
  .card p {
    font-size: 0.875rem;
  }
}

.card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.card h3,
.about-section h2 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--text);
}

.card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.card p,
.about-section p {
  margin: 0;
  color: var(--text-muted);
}

.card p {
  font-size: 0.9375rem;
}

/* About page */
.about-section {
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.about-section p {
  margin-bottom: 1rem;
}

.about-section p:last-child {
  margin-bottom: 0;
}

/* Login page */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem 2.25rem;
  width: 100%;
}

.login-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.login-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.form-link {
  font-size: 0.8125rem;
  font-weight: 500;
}

.form-input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.form-input:focus-visible {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.login-submit {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-top: 0.25rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.login-submit:hover {
  background: var(--accent-hover);
}

.login-submit:active {
  transform: scale(0.99);
}

.login-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

@media (max-width: 380px) {
  .login-card {
    padding: 1.5rem 1.5rem 1.75rem;
  }
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .site-footer {
    padding: 0.3rem 0;
  }
  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

.copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

/* Dashboard */
.container--wide {
  max-width: 1100px;
}

.dashboard-user {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dashboard-user strong {
  color: var(--accent);
}

.dashboard-main {
  padding-bottom: 4rem;
}

.dashboard-head {
  margin-bottom: 2rem;
}

.dashboard-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .dashboard-grid {
    gap: 1.5rem;
  }
}

@media (min-width: 960px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.dashboard-card-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-card-icon {
  color: var(--accent);
  font-size: 0.75rem;
}

.dashboard-stat-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.dashboard-stat-sep {
  color: var(--text-muted);
  font-weight: 500;
}

.dashboard-stat-value {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.dashboard-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.dashboard-node-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-node-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2e7d32 0%, #66bb6a 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.dashboard-card--nodes.dashboard-card--warning .dashboard-node-bar-fill {
  background: linear-gradient(90deg, #ed6c02 0%, #ff9800 100%);
}

.dashboard-card--nodes.dashboard-card--error .dashboard-node-bar-fill {
  background: linear-gradient(90deg, #c62828 0%, #ef5350 100%);
}

.dashboard-pods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dashboard-pod-phase {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
}

.dashboard-pod-phase--running {
  border-left: 3px solid #2e7d32;
}

.dashboard-pod-phase--pending {
  border-left: 3px solid #ed6c02;
}

.dashboard-pod-phase--failed {
  border-left: 3px solid #c62828;
}

.dashboard-pod-phase--unknown {
  border-left: 3px solid var(--text-muted);
}

.dashboard-pod-count {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  display: block;
}

.dashboard-pod-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-gauge-wrap {
  text-align: center;
}

.dashboard-gauge {
  position: relative;
  width: 140px;
  height: 80px;
  margin: 0 auto 0.5rem;
}

.dashboard-gauge-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dashboard-gauge-bg {
  stroke: var(--bg-elevated);
  stroke-linecap: round;
}

.dashboard-gauge-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.dashboard-card--memory .dashboard-gauge-fill {
  stroke: #5c6bc0;
}

.dashboard-card--cpu.dashboard-card--high .dashboard-gauge-fill,
.dashboard-card--memory.dashboard-card--high .dashboard-gauge-fill {
  stroke: #ed6c02;
}

.dashboard-card--cpu.dashboard-card--critical .dashboard-gauge-fill,
.dashboard-card--memory.dashboard-card--critical .dashboard-gauge-fill {
  stroke: #c62828;
}

.dashboard-gauge-value {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
}

.dashboard-gauge-detail {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.dashboard-footer-meta {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.dashboard-updated,
.dashboard-prometheus {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.dashboard-error {
  font-size: 0.8125rem;
  color: #ef5350;
  margin: 0;
  width: 100%;
}
