/* ============================================================
   spir.li design system — "anaglyph terminal"
   Bicolor duotone (red/cyan) evoking 3D-glasses stereoscopy,
   on a friendly CLI aesthetic. Light/dark synced to the OS.
   Pure CSS, no fonts loaded, no dependencies. Reuse these
   tokens verbatim when theming Authentik / Kuma.
   ============================================================ */

:root {
  color-scheme: light dark;
  --bg:     #f6f6fa;
  --panel:  #ffffff;
  --fg:     #14141a;
  --muted:  #6b6b78;
  --border: #e2e2ea;
  --red:    #e0263f;
  --cyan:   #00a9a5;
  --glow-red: rgba(224, 38, 63, .25);
  --glow-cyan: rgba(0, 169, 165, .25);
  --radius: .8rem;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:     #0a0b0f;
    --panel:  #12141b;
    --fg:     #eaeaf0;
    --muted:  #94949f;
    --border: #23252f;
    --red:    #ff4d6a;
    --cyan:   #2de6e0;
    --glow-red: rgba(255, 77, 106, .35);
    --glow-cyan: rgba(45, 230, 224, .35);
  }
}

* { box-sizing: border-box; min-width: 0; }
img { max-width: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
  position: relative;
  overflow-x: hidden;
}

/* two soft drifting blobs, red + cyan, pure CSS, GPU-cheap */
body::before, body::after {
  content: "";
  position: fixed;
  width: 40vmax;
  height: 40vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .15;
  z-index: 0;
  animation: drift 22s ease-in-out infinite alternate;
}
body::before { background: var(--glow-red); top: -10vmax; left: -10vmax; }
body::after  { background: var(--glow-cyan); bottom: -12vmax; right: -12vmax; animation-delay: -8s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4vmax, 3vmax) scale(1.15); }
}

main { position: relative; z-index: 1; width: 100%; max-width: 30rem; }

/* ---- header / anaglyph logo ---- */
.hero { text-align: center; margin-bottom: 1.5rem; }

.logo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  display: block;
  margin: 0 auto .75rem;
  cursor: pointer;
  transition: transform .25s ease, filter .25s ease;
}
.logo:hover { transform: scale(1.05) rotate(-2deg); }
.logo:active { transform: scale(.96); }

h1 {
  margin: 0 0 .35rem;
  font-size: 1.9rem;
  letter-spacing: -.02em;
  color: var(--fg);
  text-shadow: -1.5px 0 var(--red), 1.5px 0 var(--cyan);
  transition: text-shadow .3s ease;
}
h1:hover { text-shadow: -4px 0 var(--red), 4px 0 var(--cyan); }

.tagline { color: var(--muted); font-size: .85rem; margin: 0; }

/* ---- terminal window card ---- */
.terminal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.15);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 92%, var(--fg) 8%);
}
.dot { width: .6rem; height: .6rem; border-radius: 50%; }
.dot.red { background: var(--red); }
.dot.cyan { background: var(--cyan); }
.dot.muted { background: var(--muted); opacity: .5; }
.terminal-bar .path {
  margin-left: auto;
  font-size: .72rem;
  color: var(--muted);
}

.terminal-body { padding: 1.15rem 1.25rem 1.35rem; }

.prompt { color: var(--muted); font-size: .82rem; margin: 0 0 .25rem; }
.prompt .sigil { color: var(--cyan); }

.type {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--cyan);
  font-size: .88rem;
  animation: typing 2.2s steps(34, end) 1, blink .8s step-end infinite;
}
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink { 50% { border-color: transparent; } }

/* ---- what you'll get, with tooltips ---- */
ul.services { list-style: none; padding: 0; margin: 1rem 0 0; font-size: .85rem; }
ul.services li {
  padding: .35rem 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: .4rem;
}
ul.services li:last-child { border-bottom: none; }
ul.services .bullet { color: var(--red); }

/* CSS-only tooltip, works on hover (desktop) and tap-to-focus (mobile) */
[data-tip] {
  cursor: help;
  border-bottom: 1px dotted var(--muted);
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 135%;
  transform: translateX(-50%) translateY(4px);
  background: var(--fg);
  color: var(--bg);
  padding: .45rem .65rem;
  border-radius: .5rem;
  font-size: .72rem;
  line-height: 1.3;
  width: max-content;
  max-width: min(14rem, 80vw);
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 5;
}
[data-tip]:hover::after,
[data-tip]:focus::after,
[data-tip].tip-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- form ---- */
form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.35rem; }

label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .82rem;
  color: var(--muted);
}

input, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .6rem .7rem;
  color: var(--fg);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--glow-cyan);
}

button {
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-bottom: 3px solid var(--cyan);
  border-radius: .5rem;
  padding: .75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease;
}
button:hover { border-color: var(--red); }
button:active { transform: scale(.98); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

#form-status {
  min-height: 1.1rem;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
}

footer {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  margin-top: 1rem;
}
footer a { color: var(--cyan); text-decoration: none; }

/* ---- easter egg: glitch shake on the logo ---- */
@keyframes glitch-shake {
  0%, 100% { transform: translate(0, 0); filter: none; }
  20% { transform: translate(-3px, 1px); filter: drop-shadow(-2px 0 var(--red)) drop-shadow(2px 0 var(--cyan)); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-2px, 0); filter: drop-shadow(2px 0 var(--red)) drop-shadow(-2px 0 var(--cyan)); }
  80% { transform: translate(2px, 1px); }
}
.logo.glitching { animation: glitch-shake .4s ease; }

.egg-msg {
  text-align: center;
  font-size: .78rem;
  color: var(--cyan);
  height: 1.2rem;
  margin: -.5rem 0 .5rem;
  opacity: 0;
  transition: opacity .3s ease;
}
.egg-msg.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
