/* ==========================================================================
   CADCom Services — Aurora Glass CORE
   Tokens, reset, backdrop, motion. Safe to load on any page, including the
   demo applications, because it declares no component classes that could
   collide with their markup.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Canvas — deep indigo, layered from void to raised */
  --void:      #06050F;
  --canvas:    #0B0A1F;
  --canvas-2:  #12102E;
  --canvas-3:  #1A1740;

  /* Aurora accents */
  --violet:    #8B5CF6;
  --indigo:    #6366F1;
  --blue:      #4F7CFF;
  --cyan:      #22D3EE;
  --magenta:   #E879F9;
  --mint:      #34E7C5;

  /* Text — all tested against --canvas for contrast */
  --text:      #F5F4FF;  /* 17.4:1 */
  --text-2:    #BDB9DC;  /*  9.1:1 */
  --text-3:    #8D89B5;  /*  5.1:1 — large or secondary text only */

  /* Glass surfaces */
  --glass:     rgba(255, 255, 255, 0.045);
  --glass-2:   rgba(255, 255, 255, 0.075);
  --glass-3:   rgba(255, 255, 255, 0.11);
  --edge:      rgba(255, 255, 255, 0.09);
  --edge-2:    rgba(255, 255, 255, 0.16);

  /* Signature gradients */
  --grad-aurora: linear-gradient(115deg, var(--violet) 0%, var(--indigo) 32%, var(--cyan) 72%, var(--mint) 100%);
  --grad-warm:   linear-gradient(115deg, var(--magenta) 0%, var(--violet) 55%, var(--indigo) 100%);
  --grad-edge:   linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02));

  /* Elevation */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow:    0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 40px 90px rgba(0, 0, 0, 0.55);
  --glow-violet: 0 0 48px -10px rgba(139, 92, 246, 0.65);
  --glow-cyan:   0 0 48px -10px rgba(34, 211, 238, 0.55);

  /* Geometry */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Rhythm */
  --pad-section: clamp(3.75rem, 6.5vw, 6.5rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --maxw: 1200px;
  --maxw-narrow: 760px;

  /* Type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 480ms;

  --nav-h: 72px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.68;
  color: var(--text-2);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3, h4, h5 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.028em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scrollbar */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: var(--void); }
  ::-webkit-scrollbar-thumb {
    background: var(--canvas-3);
    border-radius: var(--r-pill);
    border: 3px solid var(--void);
  }
  ::-webkit-scrollbar-thumb:hover { background: #262153; }
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 2000;
  padding: 0.7rem 1.1rem;
  background: var(--canvas-3);
  color: var(--text);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-sm);
  transform: translateY(-160%);
  transition: transform 220ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   3. Aurora backdrop
   Fixed, GPU-composited, driven by transform only.
   -------------------------------------------------------------------------- */
.aurora-field {
  position: fixed;
  inset: -25vmax;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background: var(--canvas);
}

.aurora-field span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.78;
  will-change: transform;
}

.aurora-field span:nth-child(1) {
  width: 58vmax; height: 58vmax;
  top: -6vmax; left: -8vmax;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.95), transparent 70%);
  animation: drift-a 26s var(--ease-in-out) infinite alternate;
}
.aurora-field span:nth-child(2) {
  width: 52vmax; height: 52vmax;
  top: 8vmax; right: -10vmax;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.72), transparent 70%);
  animation: drift-b 32s var(--ease-in-out) infinite alternate;
}
.aurora-field span:nth-child(3) {
  width: 46vmax; height: 46vmax;
  bottom: -8vmax; left: 22vmax;
  background: radial-gradient(circle at 50% 50%, rgba(232, 121, 249, 0.6), transparent 70%);
  animation: drift-c 38s var(--ease-in-out) infinite alternate;
}
.aurora-field span:nth-child(4) {
  width: 40vmax; height: 40vmax;
  bottom: 4vmax; right: 14vmax;
  background: radial-gradient(circle at 50% 50%, rgba(52, 231, 197, 0.45), transparent 70%);
  animation: drift-a 30s var(--ease-in-out) infinite alternate-reverse;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(7vmax, 5vmax, 0) scale(1.14); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-8vmax, 7vmax, 0) scale(0.92); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to   { transform: translate3d(6vmax, -6vmax, 0) scale(1.18); }
}

/* Fine grain over the blur, stops the gradients banding */
.aurora-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   21. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .aurora-field span { animation: none; }
  .showcase-frame { transform: none; }
}

/* --------------------------------------------------------------------------
   22. Print
   -------------------------------------------------------------------------- */
@media print {
  .aurora-field, .aurora-grain, .nav, .footer, .skip-link { display: none !important; }
  body { background: #fff; color: #111; }
  .glass { background: #fff; border: 1px solid #ccc; box-shadow: none; }
  h1, h2, h3 { color: #111; }
}
