/* ===== OpenClaw Shared Styles =====
   Single source of truth for CSS variables, nav, footer, theme toggle.
   All OpenClaw pages should <link> this file.
*/

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

/* === CSS Variables (Light — default) === */
:root {
  --bg-deep: #fcfeff;
  --bg-surface: #ffffff;
  --bg-elevated: #f5f9ff;
  --coral-bright: #ef4b58;
  --coral-mid: #de3f4d;
  --coral-dark: #c43645;
  --cyan-bright: #008f87;
  --cyan-mid: #00766e;
  --text-primary: #0b1220;
  --text-secondary: #2e405c;
  --text-muted: #5f7290;
  --border-subtle: rgba(15, 23, 42, .16);
  --border-accent: rgba(239, 75, 88, .34);
  --surface-card: rgba(255, 255, 255, .88);
  --surface-card-strong: rgba(255, 255, 255, .95);
  --shadow-coral-soft: rgba(239, 75, 88, .12);
  --shadow-coral-mid: rgba(239, 75, 88, .20);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.14);
  --transition: 0.22s ease;
  --nav-height: 64px;
}

/* === Dark Theme === */
html[data-theme="dark"] {
  --bg-deep: #050810;
  --bg-surface: #0a0f1a;
  --bg-elevated: #111827;
  --coral-bright: #ff4d4d;
  --coral-mid: #e63946;
  --coral-dark: #991b1b;
  --cyan-bright: #00e5cc;
  --cyan-mid: #14b8a6;
  --text-primary: #f0f4ff;
  --text-secondary: #8892b0;
  --text-muted: #5a6480;
  --border-subtle: rgba(136, 146, 176, .15);
  --border-accent: rgba(255, 77, 77, .3);
  --surface-card: rgba(10, 15, 26, .65);
  --surface-card-strong: rgba(10, 15, 26, .8);
  --shadow-coral-soft: rgba(255, 77, 77, .15);
  --shadow-coral-mid: rgba(255, 77, 77, .25);
}

/* === Base === */
html { scroll-behavior: smooth; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* === Theme Toggle === */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card-strong);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all .2s;
  font-size: 1rem;
  color: var(--text-secondary);
}
.theme-toggle:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
  color: var(--text-primary);
}

/* === Nav === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
html[data-theme="dark"] .nav {
  background: rgba(5, 8, 16, 0.85);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 36px; height: 36px;
  flex-shrink: 0;
}
.logo-mark img {
  width: 100%; height: 100%;
  border-radius: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}
.nav-cta {
  background: linear-gradient(135deg, var(--coral-bright), var(--coral-dark));
  color: #fff !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600 !important;
  transition: opacity var(--transition), transform var(--transition) !important;
}
.nav-cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* === Footer === */
.oc-footer {
  background: var(--bg-elevated);
  padding: 56px 5% 36px;
}
.oc-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.oc-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-subtle);
}
.oc-footer-brand {
  max-width: 280px;
}
.oc-footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.oc-footer-logo-mark {
  width: 34px; height: 34px;
}
.oc-footer-logo-mark img {
  width: 100%; height: 100%;
  border-radius: 7px;
}
.oc-footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}
.oc-footer-cols {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}
.oc-footer-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.oc-footer-col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oc-footer-col-list a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.oc-footer-col-list a:hover {
  color: var(--text-secondary);
}
.oc-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
}
.oc-footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}
.oc-footer-links {
  display: flex;
  gap: 24px;
}
.oc-footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.oc-footer-links a:hover {
  color: var(--text-secondary);
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav { padding: 0 4%; }
  .oc-footer { padding: 40px 4% 28px; }
  .oc-footer-top { flex-direction: column; gap: 32px; }
  .oc-footer-cols { gap: 36px; }
  .oc-footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .nav { height: 56px; }
  .nav-cta { padding: 7px 16px; font-size: 13px; }
  .oc-footer { padding: 32px 4% 24px; }
  .oc-footer-top { padding-bottom: 28px; gap: 24px; }
  .oc-footer-cols { gap: 24px; }
  .oc-footer-bottom { padding-top: 20px; }
  .theme-toggle { width: 36px; height: 36px; top: 12px; right: 12px; }
}
