/* ============================================================
   LYNUS TECH — Design System
   Dark "command center" SaaS. Geist + Geist Mono.
   ============================================================ */

:root {
  /* Accent — overridden at runtime by Tweaks (default azure, from logo) */
  --accent: #6b8aff;
  --accent-2: #36d0e8;          /* cyan highlight (logo pixel dots) */
  --accent-soft: rgba(107, 138, 255, 0.14);
  --accent-line: rgba(107, 138, 255, 0.34);
  --accent-glow: rgba(107, 138, 255, 0.42);

  /* Surfaces */
  --bg: #0a0a0c;
  --bg-2: #0e0f12;
  --surface: rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #f4f5f7;
  --text-2: #a6abb6;
  --text-3: #6b7080;

  /* Status (semantic — independent of accent) */
  --crit: #ff5c6c;
  --crit-soft: rgba(255, 92, 108, 0.14);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.14);
  --ok: #34e0a1;
  --ok-soft: rgba(52, 224, 161, 0.14);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --maxw: 1200px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --font: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Background treatments (tweakable via [data-bg]) ---- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bg-layer .glow {
  position: absolute;
  left: 50%;
  top: -10%;
  width: 1100px;
  height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 62%);
  opacity: 0.5;
  filter: blur(20px);
  transition: background 0.4s ease;
}
.bg-layer .glow-2 {
  position: absolute;
  right: -8%;
  top: 38%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(54, 208, 232, 0.16), transparent 60%);
  filter: blur(30px);
}
.bg-layer .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
body[data-bg="grid"] .bg-layer .grid { opacity: 1; }
body[data-bg="minimal"] .bg-layer .glow { opacity: 0.28; }
body[data-bg="minimal"] .bg-layer .glow-2 { display: none; }

/* ---- Layout primitives ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 13px 20px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #07080c;
  box-shadow: 0 10px 30px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  box-shadow: 0 14px 38px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.35);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-strong); border-color: var(--accent-line); }
.btn-sm { padding: 9px 15px; font-size: 13.5px; border-radius: 9px; }

/* ---- Glass card ---- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}

/* ---- Section spacing ---- */
.section { padding: 96px 0; position: relative; z-index: 1; }
.section-head { max-width: 680px; }
.section-head h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin: 16px 0 0;
  text-wrap: balance;
}
.section-head p {
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.55;
  margin-top: 16px;
  text-wrap: pretty;
}

/* ---- Wordmark ---- */
.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.wordmark-gif {
  height: 64px;
  width: auto;
  display: block;
  mix-blend-mode: screen;
}

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; border: 3px solid var(--bg); }
::selection { background: var(--accent); color: #07080c; }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* ---- Three.js canvas ---- */
.three-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.three-bg.three-ready { opacity: 1; }

/* ---- Custom cursor ---- */
.custom-cursor, .custom-cursor * { cursor: none !important; }

.cursor-bubble {
  position: fixed;
  top: -32px; left: -32px;
  width: 64px; height: 64px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
  box-shadow: 0 0 24px var(--accent-glow), 0 0 60px rgba(107,138,255,0.12);
  transition: width .3s ease, height .3s ease, top .3s ease, left .3s ease,
              background .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.cursor-bubble.cursor-hover {
  top: -44px; left: -44px;
  width: 88px; height: 88px;
  background: rgba(107, 138, 255, 0.18);
  box-shadow: 0 0 36px var(--accent-glow), 0 0 90px rgba(107,138,255,0.18);
  border-color: var(--accent);
}

/* ---- Page loader ---- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  animation: loaderOut 0.65s ease 1.4s forwards;
}
@keyframes loaderOut {
  to { opacity: 0; pointer-events: none; }
}

.loader-mark {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  transform: scale(2.2);
  transform-origin: center bottom;
  animation: loaderMarkIn 0.9s cubic-bezier(.16,1,.3,1) 0.1s both;
}
.loader-mark .logo-bars { height: auto; padding-bottom: 4px; }
.loader-mark .logo-px   { width: 7px; height: 7px; }
.loader-text {
  font-size: 28px;
  animation: logoTxtIn 0.5s ease 0.25s both !important;
}

@keyframes loaderMarkIn {
  from { opacity: 0; transform: scale(1.9) translateY(12px); }
  to   { opacity: 1; transform: scale(2.2) translateY(0); }
}

.loader-track {
  width: 200px;
  height: 1.5px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  animation: loaderFill 1.3s cubic-bezier(.25,.46,.45,.94) forwards;
}
@keyframes loaderFill {
  from { width: 0; }
  to   { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring, .page-loader { display: none; }
  html { scroll-behavior: auto; }
}
