/*!
 * Wolf Cloud Style System
 * Canonical design baseline for Wolf Cloud frontend projects.
 *
 * Maintainer: Liam Wolf <liam@wolf-cloud.com>
 * Repository: git.wolf-cloud.com/liamwolf/wolf-cloud-style-system.git
 *
 * Copyright (C) 2026 Liam Wolf
 * Licensed under the GNU Affero General Public License v3.0 or later.
 * You should have received a copy of the AGPL along with this file.
 * If not, see <https://www.gnu.org/licenses/agpl-3.0.html>.
 *
 * Design principles:
 * - Dark, atmospheric, technical, premium.
 * - Strong blue brand accent with restrained status colors.
 * - Soft glass surfaces over a deep layered background.
 * - IBM Plex Sans for body copy, IBM Plex Mono for UI labels and controls.
 * - High clarity, low clutter, controlled glow.
 * - Rounded corners, thin translucent borders, soft depth.
 * - Motion should feel calm and precise, never playful or noisy.
 *
 * Theme:
 * - Default is dark mode.
 * - Light mode: set data-theme="light" on the <html> element.
 *
 */

/* ── Fonts (Wolf Cloud CDN) ─────────────────────────────────── */
@import url("https://static.wolf-cloud.com/fonts/fonts.css");

:root {
  color-scheme: dark;

  /* Core palette */
  --ink:         #080c10;
  --ink-2:       #0d1420;
  --surface:     rgba(10, 16, 28, 0.80);
  --surface-2:   rgba(14, 20, 36, 0.60);
  --surface-3:   rgba(18, 28, 46, 0.72);
  --line:        rgba(255, 255, 255, 0.06);
  --line-hi:     rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Brand */
  --brand:       #2e7fff;
  --brand-2:     #1d6be0;
  --brand-soft:  #6eb8ff;
  --brand-pale:  #a8d8ff;
  --brand-dim:   rgba(46, 127, 255, 0.18);
  --brand-glow:  rgba(46, 127, 255, 0.30);
  --brand-ring:  rgba(46, 127, 255, 0.12);

  /* Text */
  --text:        #eef2ff;
  --muted:       rgba(238, 242, 255, 0.50);
  --subtle:      rgba(238, 242, 255, 0.25);
  --text-soft:   rgba(238, 242, 255, 0.78);

  /* Status */
  --ok:          #22c55e;
  --ok-bg:       rgba(34, 197, 94, 0.09);
  --ok-bdr:      rgba(34, 197, 94, 0.25);
  --deg:         #f59e0b;
  --deg-bg:      rgba(245, 158, 11, 0.09);
  --deg-bdr:     rgba(245, 158, 11, 0.25);
  --err:         #ef4444;
  --err-bg:      rgba(239, 68, 68, 0.09);
  --err-bdr:     rgba(239, 68, 68, 0.25);
  --info:        #38bdf8;
  --info-bg:     rgba(56, 189, 248, 0.10);
  --info-bdr:    rgba(56, 189, 248, 0.24);

  /* Neutral UI badge state */
  --chip-bdr:    rgba(238, 242, 255, 0.10);
  --chip-bg:     rgba(238, 242, 255, 0.04);
  --chip-text:   rgba(238, 242, 255, 0.35);

  /* Typography */
  --font-sans: "IBM Plex Sans", "Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Brand assets */
  --logo:          url("https://static.wolf-cloud.com/logos/wolf-cloud/logo.svg");
  --logo-full:     url("https://static.wolf-cloud.com/logos/wolf-cloud/full-logo.svg");
  --logo-png:      url("https://static.wolf-cloud.com/logos/wolf-cloud/logo.png");
  --logo-full-png: url("https://static.wolf-cloud.com/logos/wolf-cloud/full-logo.png");
  --favicon:       url("https://static.wolf-cloud.com/logos/wolf-cloud/favicon.ico");

  /* Sizing */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   16px;
  --radius-pill: 999px;

  /* Layout */
  --page-width: 820px;
  --page-pad-x: 1.5rem;
  --page-pad-y: 4rem;

  /* Shadows */
  --shadow-card:      0 8px 40px rgba(4, 8, 20, 0.50);
  --shadow-card-soft: 0 4px 18px rgba(4, 8, 20, 0.30);
  --shadow-brand:     0 2px 12px rgba(46, 127, 255, 0.35);

  /* Motion */
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 150ms;
  --dur-mid:  220ms;
  --dur-slow: 450ms;

  /* Effects */
  --blur-card: 20px;
  --blur-soft: 16px;
  --grid-size: 48px;
}

/* ── Light mode ─────────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;

  /* Core palette */
  --ink:         #eef2ff;
  --ink-2:       #e2e8f7;
  --surface:     rgba(255, 255, 255, 0.88);
  --surface-2:   rgba(245, 248, 255, 0.80);
  --surface-3:   rgba(235, 240, 255, 0.90);
  --line:        rgba(46, 80, 200, 0.07);
  --line-hi:     rgba(46, 80, 200, 0.13);
  --line-strong: rgba(46, 80, 200, 0.20);

  /* Brand */
  --brand-dim:   rgba(46, 127, 255, 0.10);
  --brand-glow:  rgba(46, 127, 255, 0.20);
  --brand-ring:  rgba(46, 127, 255, 0.15);

  /* Text */
  --text:        #0d1420;
  --muted:       rgba(13, 20, 50, 0.58);
  --subtle:      rgba(13, 20, 50, 0.33);
  --text-soft:   rgba(13, 20, 50, 0.80);

  /* Status */
  --ok:          #16a34a;
  --ok-bg:       rgba(22, 163, 74, 0.08);
  --ok-bdr:      rgba(22, 163, 74, 0.25);
  --deg:         #d97706;
  --deg-bg:      rgba(217, 119, 6, 0.08);
  --deg-bdr:     rgba(217, 119, 6, 0.24);
  --err:         #dc2626;
  --err-bg:      rgba(220, 38, 38, 0.08);
  --err-bdr:     rgba(220, 38, 38, 0.22);
  --info:        #0284c7;
  --info-bg:     rgba(2, 132, 199, 0.08);
  --info-bdr:    rgba(2, 132, 199, 0.22);

  /* Neutral UI badge state */
  --chip-bdr:    rgba(13, 20, 50, 0.12);
  --chip-bg:     rgba(13, 20, 50, 0.04);
  --chip-text:   rgba(13, 20, 50, 0.45);

  /* Shadows */
  --shadow-card:      0 4px 24px rgba(13, 20, 80, 0.10);
  --shadow-card-soft: 0 2px 10px rgba(13, 20, 80, 0.07);
  --shadow-brand:     0 2px 12px rgba(46, 127, 255, 0.22);
}

/* ── Base reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 1200px 500px at 15% 0%, rgba(46,127,255,0.22), transparent 60%),
    radial-gradient(ellipse 600px 600px at 85% 5%, rgba(14,165,233,0.16), transparent 55%),
    radial-gradient(ellipse 1000px 700px at 50% 100%, rgba(30,80,200,0.14), transparent 65%),
    var(--ink);
  overflow-x: hidden;
}

/* Fixed so it covers the viewport regardless of scroll position */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(46,127,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,127,255,0.035) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse 1200px 500px at 15% 0%, rgba(46,127,255,0.09), transparent 60%),
    radial-gradient(ellipse 600px 600px at 85% 5%, rgba(14,165,233,0.07), transparent 55%),
    radial-gradient(ellipse 1000px 700px at 50% 100%, rgba(30,80,200,0.05), transparent 65%),
    var(--ink);
}

[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(46,127,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,127,255,0.055) 1px, transparent 1px);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ── Page shell ─────────────────────────────────────────────── */
.wc-page {
  position: relative;
  z-index: 1;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-pad-x) var(--page-pad-y);
}

/* ── Typography ─────────────────────────────────────────────── */
.wc-eyebrow,
.wc-label,
.wc-kicker,
.wc-mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.wc-eyebrow {
  font-size: .72rem;
  color: var(--muted);
}

.wc-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.wc-title em,
.wc-text-gradient {
  font-style: normal;
  background: linear-gradient(110deg, var(--brand-soft) 15%, var(--brand-pale) 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wc-lead {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 300;
  color: var(--muted);
}

.wc-text-muted  { color: var(--muted); }
.wc-text-subtle { color: var(--subtle); }
.wc-text-soft   { color: var(--text-soft); }

/* ── Logo components ────────────────────────────────────────── */
.wc-logo {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-image: var(--logo);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.wc-logo-full {
  display: inline-block;
  width: 180px;
  max-width: 100%;
  height: 36px;
  background-image: var(--logo-full);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
}

.wc-logo-glow {
  filter: drop-shadow(0 4px 14px rgba(46,127,255,.28));
}

[data-theme="light"] .wc-logo-full {
  filter: invert(1) hue-rotate(180deg) saturate(1.05) brightness(.88);
}

[data-theme="light"] .wc-logo {
  filter: brightness(0) opacity(.82);
}

[data-theme="light"] .wc-logo-glow {
  filter: brightness(0) opacity(.82) drop-shadow(0 4px 14px rgba(46,127,255,.18));
}

/* ── Header pattern ─────────────────────────────────────────── */
.wc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Surface primitives ─────────────────────────────────────── */
.wc-card,
.wc-panel,
.wc-surface {
  background: var(--surface);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(var(--blur-card));
}

.wc-surface-soft {
  background: var(--surface-2);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(var(--blur-soft));
}

.wc-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi) 30%, var(--line-hi) 70%, transparent);
}

/* ── Button system ──────────────────────────────────────────── */
.wc-btn-primary,
.wc-btn-ghost,
.wc-btn-chip {
  border: none;
  cursor: pointer;
  transition:
    background var(--dur-mid),
    border-color var(--dur-mid),
    color var(--dur-mid),
    opacity var(--dur-mid),
    box-shadow var(--dur-mid),
    transform var(--dur-fast);
}

.wc-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .65rem 1.3rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-brand);
}

.wc-btn-primary:hover {
  opacity: .88;
  box-shadow: 0 4px 18px rgba(46,127,255,.45);
}

.wc-btn-primary:active {
  opacity: .75;
}

.wc-btn-primary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.wc-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .6rem;
  border-radius: var(--radius-sm);
  background: none;
  color: rgba(110,184,255,.75);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.wc-btn-ghost:hover {
  color: #afd6ff;
  background: rgba(46,127,255,.1);
}

.wc-btn-ghost:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.wc-btn-chip,
.wc-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-hi);
  background: rgba(46,127,255,.04);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .04em;
}

.wc-btn-chip:hover,
.wc-chip:hover {
  background: rgba(46,127,255,.12);
  border-color: rgba(46,127,255,.3);
  color: #afd6ff;
}

.wc-btn-chip:focus-visible,
.wc-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

button:disabled,
.wc-disabled,
[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Form controls ──────────────────────────────────────────── */
.wc-input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-hi);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(var(--blur-card));
  transition: border-color var(--dur-mid), box-shadow var(--dur-mid);
}

.wc-input-wrap:focus-within {
  border-color: rgba(46,127,255,.45);
  box-shadow:
    var(--shadow-card),
    0 0 0 3px var(--brand-ring),
    inset 0 1px 0 rgba(255,255,255,.05);
}

.wc-input,
.wc-select {
  width: 100%;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  caret-color: var(--brand);
}

.wc-input {
  padding: 1rem .5rem;
  font-family: var(--font-mono);
  font-size: .95rem;
}

.wc-input::placeholder {
  color: var(--subtle);
}

.wc-field-error {
  min-height: 1.1rem;
  margin-top: .55rem;
  text-align: center;
  color: rgba(239, 68, 68, .82);
  font-family: var(--font-mono);
  font-size: .68rem;
}

/* ── Badges and status ──────────────────────────────────────── */
.wc-badge,
.wc-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .38rem .9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--chip-bdr);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wc-badge.ok,
.wc-status.ok {
  background: var(--ok-bg);
  border-color: var(--ok-bdr);
  color: var(--ok);
}

.wc-badge.deg,
.wc-status.deg {
  background: var(--deg-bg);
  border-color: var(--deg-bdr);
  color: var(--deg);
}

.wc-badge.err,
.wc-status.err {
  background: var(--err-bg);
  border-color: var(--err-bdr);
  color: var(--err);
}

.wc-badge.info,
.wc-status.info {
  background: var(--info-bg);
  border-color: var(--info-bdr);
  color: var(--info);
}

.wc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Grid and tiles ─────────────────────────────────────────── */
.wc-grid {
  display: grid;
  gap: .75rem;
}

.wc-grid-cards {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.wc-shortcut,
.wc-tile {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line-hi);
  background: var(--surface);
  backdrop-filter: blur(var(--blur-soft));
  transition: border-color var(--dur-mid), background var(--dur-mid), transform var(--dur-fast);
}

.wc-shortcut:hover,
.wc-tile:hover {
  border-color: rgba(46,127,255,.3);
  background: rgba(46,127,255,.05);
  transform: translateY(-1px);
}

.wc-shortcut-title {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .3rem;
}

.wc-shortcut-desc {
  font-size: .75rem;
  font-weight: 300;
  color: var(--muted);
}

/* ── Stat blocks ────────────────────────────────────────────── */
.wc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-hi);
  border-top: none;
  background: var(--surface);
  backdrop-filter: blur(var(--blur-card));
}

.wc-stat {
  padding: 1.1rem 1.4rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wc-stat:nth-child(3n) {
  border-right: none;
}

.wc-stat-label {
  margin-bottom: .45rem;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wc-stat-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
}

/* ── Motion ─────────────────────────────────────────────────── */
.wc-fade-up {
  animation: wc-fade-up var(--dur-slow) ease-out both;
}

@keyframes wc-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wc-spin {
  to { transform: rotate(360deg); }
}

/* ── Particles ──────────────────────────────────────────────── */
#wc-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .wc-fade-up {
    animation: none;
  }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 580px) {
  .wc-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .wc-stat:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .wc-stat:nth-child(2n) {
    border-right: none;
  }

  .wc-title {
    font-size: 1.85rem;
  }

  .wc-page {
    padding: 0 1rem 3rem;
  }
}
