/* ================================================================
   CGWALLS — Design System & Global Styles
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&display=swap');

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

:root {
  /* colours */
  --bg:            #000000;
  --surface:       #080808;
  --surface2:      #111111;
  --surface3:      #1a1a1a;
  --border:        #222222;
  --border-hi:     #333333;

  --accent:        #aaaaaa;
  --accent-dim:    rgba(170,170,170,.13);
  --accent-glow:   0 0 28px rgba(170,170,170,.32);

  --cyan:          #aaaaaa;
  --cyan-dim:      rgba(170,170,170,.13);

  --purple:        #aaaaaa;
  --purple-dim:    rgba(170,170,170,.13);

  --text:          #eeeeee;
  --text2:         #aaaaaa;
  --muted:         #666666;

  /* shape */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-full: 9999px;

  /* shadow */
  --sh-sm:  0 2px 8px  rgba(0,0,0,.45);
  --sh-md:  0 8px 24px rgba(0,0,0,.55);
  --sh-lg:  0 24px 64px rgba(0,0,0,.7);

  /* motion */
  --ease:   cubic-bezier(.4,0,.2,1);
  --tf:     .15s;
  --tb:     .22s;
  --ts:     .4s;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── layout ── */
main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 52px 40px 96px;
}

/* ── section labels ── */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.section-label h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}
.section-label .pill {
  background: var(--accent);
  color: #0a0a0d;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
  letter-spacing: 1px;
  font-family: 'Space Mono', monospace;
}

/* ── divider ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-hi), transparent);
  margin: 56px 0;
}

/* ── shimmer skeleton ── */
@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 1600px 100%;
  animation: shimmer 1.6s infinite;
}

/* ── animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1);   }
}

/* ── scrollbar ── */
::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: var(--bg); }
::-webkit-scrollbar-thumb    { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── back to top ── */
#backToTop {
  position: fixed; bottom: 32px; right: 32px; z-index: 200;
  width: 44px; height: 44px; border-radius: var(--r-full);
  background: var(--surface2);
  border: 1.5px solid var(--border-hi);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--tb) var(--ease), transform var(--tb) var(--ease),
              background var(--tf) var(--ease), border-color var(--tf) var(--ease), color var(--tf) var(--ease);
  pointer-events: none;
  box-shadow: var(--sh-md);
}
#backToTop.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
#backToTop:hover   { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
#backToTop svg     { width: 18px; height: 18px; }

/* ── toast ── */
#toastContainer {
  position: fixed; bottom: 88px; right: 32px; z-index: 500;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  box-shadow: var(--sh-md);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s var(--ease) both;
  pointer-events: auto;
}
.toast.success { border-color: var(--accent); }
.toast.success svg { color: var(--accent); }
@keyframes toastIn   { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
@keyframes toastOut  { from { opacity:1; } to { opacity:0; transform:translateX(20px); } }

/* ── empty / error state ── */
.empty-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 80px 20px;
  color: var(--muted); font-family: 'Space Mono', monospace; text-align: center;
}
.empty-state svg  { opacity: .5; }
.empty-state p    { font-size: 15px; font-weight: 700; color: var(--text2); }
.empty-state span { font-size: 12px; }

/* ── responsive breakpoints ── */
@media (max-width: 900px) { main { padding: 36px 24px 72px; } }
@media (max-width: 500px) { main { padding: 24px 16px 56px; } }
