/* ============================================================
   Castle Tech Team · Design tokens, reset, ambient background
   ============================================================ */

:root {
  /* Surface */
  --bg:            #0b0c10;
  --bg-2:          #121318;
  --bg-elev:       #17181e;
  --bg-elev-2:     #1d1e25;
  --surface:       rgba(255, 255, 255, 0.028);
  --surface-hov:   rgba(255, 255, 255, 0.055);
  --border:        rgba(235, 232, 224, 0.08);
  --border-strong: rgba(235, 232, 224, 0.18);

  /* Text */
  --ink:           #ebe8e0;
  --ink-dim:       #9b988f;
  --ink-mute:      #6a6862;

  /* Signals */
  --accent-blue:   #6aa8ff;
  --danger:        #e06868;
  --success:       #7ad3a8;

  /* Shape */
  --r-xl: 20px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 80px rgba(0,0,0,0.55);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(106,168,255,0.3); color: #fff; }

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

button { font-family: inherit; }

kbd {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink-dim);
  background: rgba(255,255,255,0.03);
  letter-spacing: 0.02em;
}

/* ============================================================
   Ambient background — animated aurora
   ============================================================ */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at top, #141620 0%, #0b0c10 55%);
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  will-change: transform;
}

.ambient-glow--1 {
  width: 560px; height: 560px;
  background: #2a4a7a;
  top: -180px; left: 10%;
  animation: drift1 22s var(--ease) infinite alternate;
}

.ambient-glow--2 {
  width: 460px; height: 460px;
  background: #5a3820;
  top: -120px; right: 6%;
  opacity: 0.38;
  animation: drift2 28s var(--ease) infinite alternate;
}

.ambient-glow--3 {
  width: 380px; height: 380px;
  background: #3a2a6a;
  top: 40%; left: 50%;
  transform: translateX(-50%);
  opacity: 0.28;
  animation: drift3 32s var(--ease) infinite alternate;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

@keyframes drift1 {
  from { transform: translate(0, 0)    scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}
@keyframes drift2 {
  from { transform: translate(0, 0)     scale(1); }
  to   { transform: translate(-50px, 30px) scale(1.08); }
}
@keyframes drift3 {
  from { transform: translate(-50%, 0)    scale(1); }
  to   { transform: translate(-55%, -40px) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-glow { animation: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
