/* ==========================================================================
   GhostTrace — Premium design system (shared)
   Matches index.html: soft blue + glass, Inter type. Adds a real dark theme
   and a functional light/dark toggle for connect / contact / privacy.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --surface: rgba(255,255,255,.65);
  --surface-strong: rgba(255,255,255,.84);
  --surface-solid: #ffffff;
  --border: rgba(255,255,255,.82);
  --border-soft: rgba(148,163,184,.20);
  --border-blue: rgba(0,102,255,.18);
  --text: #0f172a;
  --text-2: #1e293b;
  --muted: #64748b;
  --dim: #94a3b8;
  --faint: #cbd5e1;

  --blue: #0066ff;
  --blue-dark: #0052cc;
  --blue-2: #00a3ff;
  --cyan: #00d2ff;
  --green: #059669;
  --green-soft: rgba(5,150,105,.09);
  --amber: #b7791f;
  --amber-soft: rgba(183,121,31,.09);
  --rose: #e11d48;
  --rose-soft: rgba(225,29,72,.09);

  --blue-soft: rgba(0,102,255,.07);
  --blue-glow: rgba(0,102,255,.16);
  --line: rgba(148,163,184,.18);
  --line-bright: rgba(148,163,184,.30);
  --nav-bg: rgba(255,255,255,.72);
  --scroll-thumb: #cbd5e1;

  --input-bg: #ffffff;
  --code-bg: #f6f8fc;

  --font-head: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --r: 20px;
  --r-sm: 12px;
  --r-pill: 9999px;
}

/* ---------- DARK THEME ---------- */
html[data-theme="dark"] {
  --bg: #07101d;
  --bg-alt: #0b1524;
  --surface: rgba(15,23,42,.66);
  --surface-strong: rgba(15,23,42,.82);
  --surface-solid: #0d1726;
  --border: rgba(255,255,255,.10);
  --border-soft: rgba(148,163,184,.18);
  --border-blue: rgba(0,163,255,.25);
  --text: #eef6ff;
  --text-2: #dbeafe;
  --muted: #94a3b8;
  --dim: #64748b;
  --faint: #475569;

  --blue: #3b8bff;
  --blue-dark: #0066ff;
  --blue-2: #38bdff;
  --green: #34d399;
  --green-soft: rgba(52,211,153,.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251,191,36,.12);
  --rose: #fb7185;
  --rose-soft: rgba(251,113,133,.12);

  --line: rgba(148,163,184,.13);
  --line-bright: rgba(148,163,184,.24);
  --nav-bg: rgba(7,16,29,.72);
  --scroll-thumb: #334155;

  --input-bg: rgba(255,255,255,.03);
  --code-bg: #0b1422;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(180deg, #fff 0%, #fbfdff 36%, var(--bg-alt) 100%);
  line-height: 1.5;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #07101d 0%, #091321 50%, #0b1524 100%);
}

/* Ambient glows */
body::before {
  content: "";
  position: fixed;
  width: 720px; height: 520px;
  top: -180px; right: -100px;
  z-index: 0; pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,163,255,.19) 0%, rgba(0,210,255,.08) 36%, transparent 72%);
  filter: blur(100px);
  opacity: .72;
}
body::after {
  content: "";
  position: fixed;
  width: 680px; height: 460px;
  left: -300px; top: 360px;
  z-index: 0; pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,102,255,.07), transparent 70%);
  filter: blur(110px);
  opacity: .7;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(0,102,255,.18); color: var(--text); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; }

/* ---------- Layout ---------- */
.shell {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.narrow { max-width: 820px; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.08;
}

.h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); letter-spacing: -.05em; line-height: 1.04; }
.h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); letter-spacing: -.045em; }
.h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.03em; }

.accent {
  color: var(--blue);
  background: linear-gradient(135deg, #0052cc 0%, #0066ff 45%, #00a3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .accent {
  background: linear-gradient(135deg, #4b9dff 0%, #38bdff 55%, #7fd8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 62ch;
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ---------- Glass panel / card ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  box-shadow:
    0 8px 32px rgba(0,102,255,.07),
    inset 0 1px 0 rgba(255,255,255,.92);
  border-radius: var(--r);
  position: relative;
  transition: border-color .28s ease, transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease, background .28s ease;
}
html[data-theme="dark"] .card {
  box-shadow: 0 8px 32px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
}
.card::before {
  content: "";
  position: absolute;
  left: 12%; right: 12%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  pointer-events: none;
}
html[data-theme="dark"] .card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
}
.card:hover { border-color: rgba(0,102,255,.16); }
.card.lift:hover {
  transform: translateY(-4px);
  box-shadow:
    0 22px 52px rgba(15,23,42,.08),
    0 8px 28px rgba(0,102,255,.08),
    inset 0 1px 0 rgba(255,255,255,.95);
}
html[data-theme="dark"] .card.lift:hover {
  box-shadow: 0 22px 52px rgba(0,0,0,.4), 0 8px 28px rgba(0,163,255,.1), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 14px;
  z-index: 100;
  width: min(1240px, calc(100% - 28px));
  margin: 14px auto 0;
  padding: 10px 14px;
  background: var(--nav-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(226,232,240,.85);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.95);
}
html[data-theme="dark"] .nav {
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 12px 36px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(0,102,255,.12), rgba(0,210,255,.07));
  border: 1px solid rgba(0,102,255,.16);
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.brand-mark svg { stroke: var(--blue) !important; }

.nav-links { display: flex; gap: 25px; list-style: none; font-size: .82rem; font-weight: 500; }
.nav-links a { color: var(--muted); transition: color .18s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

@media (max-width: 900px) { .nav-links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 21px;
  font-family: var(--font-body);
  font-size: .87rem;
  font-weight: 650;
  letter-spacing: -.015em;
  border-radius: 11px;
  border: 1px solid transparent;
  transition: all .22s cubic-bezier(.16,1,.3,1);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.btn-primary {
  color: #fff;
  background: var(--blue);
  border-color: rgba(0,82,204,.55);
  box-shadow: 0 4px 20px rgba(0,102,255,.28);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(0,102,255,.35);
  filter: brightness(1.025);
}
.btn-ghost {
  color: var(--text-2);
  background: rgba(255,255,255,.56);
  border-color: rgba(148,163,184,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.88);
  border-color: rgba(0,102,255,.18);
  transform: translateY(-1px);
}
html[data-theme="dark"] .btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
html[data-theme="dark"] .btn-ghost:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(0,163,255,.3);
}
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .78rem; border-radius: 10px; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(148,163,184,.22);
  color: var(--muted);
  cursor: pointer;
  transition: all .22s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
.theme-toggle:hover { color: var(--blue); border-color: rgba(0,102,255,.20); transform: translateY(-1px); }
html[data-theme="dark"] .theme-toggle {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- Section header helpers ---------- */
.section { padding: 88px 0; position: relative; }
.section-sm { padding: 44px 0; position: relative; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.64);
  border: 1px solid rgba(0,102,255,.13);
  box-shadow: 0 5px 18px rgba(0,102,255,.06), inset 0 1px 0 rgba(255,255,255,.95);
  font-size: .73rem;
  font-weight: 550;
  color: var(--muted);
}
html[data-theme="dark"] .status { background: rgba(255,255,255,.04); }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10b981; position: relative; flex-shrink: 0;
}
.dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(16,185,129,.45);
  animation: ring 2s cubic-bezier(.2,.6,.3,1) infinite;
}
@keyframes ring {
  0% { transform: scale(.55); opacity: .85; }
  70% { transform: scale(1.75); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Form fields ---------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: .9rem;
  outline: none;
  color: var(--text);
  resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,102,255,.14);
}
.field textarea { min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field .hint { font-size: .77rem; color: var(--dim); margin-top: 6px; }

/* ---------- Code block ---------- */
.code {
  border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
  background: var(--code-bg);
  overflow: hidden;
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 36px; padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(148,163,184,.06);
}
.code-name { font-family: var(--font-mono); font-size: .7rem; color: var(--dim); }
.code pre {
  margin: 0; padding: 16px;
  font-family: var(--font-mono); font-size: .755rem; line-height: 1.75;
  color: var(--text-2); overflow-x: auto;
}
.code .k { color: var(--blue); }
.code .s { color: var(--green); }
.code .c { color: var(--dim); }
.copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--border-soft);
  font-size: .68rem; font-weight: 600; color: var(--dim);
  transition: color .18s ease, border-color .18s ease;
}
.copy:hover { color: var(--blue); border-color: var(--border-blue); }
.copy.done { color: var(--green); border-color: rgba(5,150,105,.4); }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 16px; }
.step { display: flex; gap: 18px; padding: 24px; }
.step-n {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  background: rgba(0,102,255,.09);
  border: 1px solid var(--border-blue);
  color: var(--blue);
}
.step h3 { margin-bottom: 6px; }
.step p { font-size: .885rem; color: var(--muted); line-height: 1.6; }

/* ---------- Footer ---------- */
.foot {
  padding: 62px 0 32px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(244,247,250,.68), rgba(238,243,248,.9));
  margin-top: 40px;
}
html[data-theme="dark"] .foot {
  background: linear-gradient(180deg, rgba(9,19,33,.6), rgba(7,16,29,.9));
}
.foot-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.foot h4 {
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .11em;
  color: var(--dim); margin-bottom: 14px; text-transform: uppercase;
}
.foot ul { list-style: none; display: grid; gap: 8px; }
.foot ul a { font-size: .82rem; color: var(--muted); transition: color .18s ease; }
.foot ul a:hover { color: var(--blue); }
.foot-blurb { font-size: .82rem; color: var(--muted); max-width: 320px; margin-top: 12px; line-height: 1.6; }
.foot-base {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  margin-top: 36px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .67rem; color: var(--dim);
  letter-spacing: .035em;
}
.foot-simple {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: .67rem; color: var(--dim);
  letter-spacing: .035em;
}

@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
}

/* ---------- Reveal ---------- */
.rise {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s cubic-bezier(.16,1,.3,1), transform .55s cubic-bezier(.16,1,.3,1);
}
.rise.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .rise { opacity: 1; transform: none; }
}
