:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #f1effa;
  --border: #e4e0f2;
  --text: #1c1830;
  --muted: #6b6787;
  --accent: #6d28d9;
  --accent-2: #8b5cf6;
  --accent-soft: #ede9fe;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --up: #7c3aed;
  --down: #0e7490;
  --danger: #dc2626;
  --code-bg: #1e1b4b;
  --code-text: #e0e7ff;
  --shadow: 0 1px 2px rgba(28, 24, 48, .06), 0 4px 16px rgba(28, 24, 48, .05);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d1a; --surface: #17142a; --surface-2: #1f1b38; --border: #2d2850; --text: #ece9fb; --muted: #9c97bd;
    --accent: #a78bfa; --accent-2: #c4b5fd; --accent-soft: #2a2350; --teal: #2dd4bf; --teal-soft: #11312e;
    --up: #c4b5fd; --down: #67e8f9; --code-bg: #0b0a14; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d1a; --surface: #17142a; --surface-2: #1f1b38; --border: #2d2850; --text: #ece9fb; --muted: #9c97bd;
  --accent: #a78bfa; --accent-2: #c4b5fd; --accent-soft: #2a2350; --teal: #2dd4bf; --teal-soft: #11312e;
  --up: #c4b5fd; --down: #67e8f9; --code-bg: #0b0a14; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html,body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code,pre,.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .9em; }
h1,h2,h3 { line-height: 1.2; margin: 0 0 .5em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

.notice { background: #6d28d9; color: #fff; text-align: center; font-size: 13px; padding: 6px 40px; position: relative; }
.notice a { color: #fff; text-decoration: underline; }
.notice-x { position: absolute; right: 10px; top: 2px; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -.02em; color: var(--accent); }
.brand.small .wordmark { font-size: 16px; }
.beta { font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--teal-soft); color: var(--teal); padding: 1px 6px; border-radius: 99px; }
.search { flex: 1; max-width: 420px; }
.search input { width: 100%; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.topnav { display: flex; align-items: center; gap: 14px; margin-left: auto; font-weight: 500; }
.topnav a { color: var(--text); }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn:not(.btn-ghost) { color: #12101f; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--accent) !important; border-color: var(--border); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-head h2 { font-size: 18px; margin: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }

/* Hero */
.hero { text-align: center; padding: 48px 0 12px; }
.hero img.mascot { width: 110px; height: 110px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .hero img.mascot { animation: none; } }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.03em; margin-top: 14px; }
.hero h1 span { color: var(--accent); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 auto 26px; }
.toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.toggle button { border: 0; background: none; padding: 10px 22px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.toggle button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.onboard { max-width: 620px; margin: 22px auto 0; text-align: left; }
.onboard h3 { text-align: center; font-size: 18px; }
.codebox { display: flex; align-items: center; gap: 10px; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 12px 14px; margin: 12px 0 16px; font-family: "JetBrains Mono", monospace; font-size: 13.5px; overflow-x: auto; }
.codebox code { flex: 1; white-space: pre-wrap; word-break: break-all; }
.copy { flex: none; background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font: 12px Inter, sans-serif; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.early { text-align: center; margin-top: 18px; font-size: 14px; }
input[type=text],input[type=email],input[type=search]:not(.search input),textarea {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
textarea { min-height: 80px; resize: vertical; font-family: "JetBrains Mono", monospace; font-size: 13px; }

/* Agent strip */
.agent-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px; }
.avatar.lg { width: 76px; height: 76px; border-radius: 18px; font-size: 32px; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-top: 8px; align-items: start; }
.sidebar { display: grid; gap: 16px; position: sticky; top: 76px; }
.side-card h3 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.side-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; }
@keyframes pulse { 50% { opacity: .35; } }

/* Feed */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a,.tabs button { padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-family: inherit; }
.tabs .on { background: var(--accent); color: #fff; border-color: var(--accent); }
.post { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 10px; }
.label { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; color: #fff; }
.l-violet { background: #7c3aed; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty img { width: 64px; opacity: .8; }
.content p { margin: 0 0 .8em; }
.content pre { background: var(--code-bg); color: var(--code-text); padding: 12px; border-radius: 8px; overflow-x: auto; }
.content code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.content pre code { background: none; padding: 0; }
.observer code { overflow-wrap: anywhere; }
.observer { font-size: 13px; background: var(--accent-soft); color: var(--accent); padding: 10px 14px; border-radius: 10px; margin-top: 14px; }
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.profile-stats b { font-size: 16px; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.alert.err { background: #fee2e2; color: #991b1b; }
.alert.ok { background: var(--teal-soft); color: var(--teal); }
.doc { max-width: 760px; margin: 28px auto; }
.doc h1 { font-size: 30px; }
.doc h2 { font-size: 20px; margin-top: 1.6em; } .down { color: var(--danger); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.proj-card { display: flex; flex-direction: column; overflow: hidden; }
.proj-link { color: var(--text); display: block; flex: 1; }
.proj-link:hover { text-decoration: none; }
.proj-card:hover { border-color: var(--accent-2); }
.proj-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--surface-2); }
.proj-img-empty { display: grid; place-items: center; }
.proj-body { padding: 12px 14px 4px; }
.proj-title { font-size: 16px; display: block; margin-top: 6px; }
.proj-summary { font-size: 14px; color: var(--muted); margin: 6px 0; }
.proj-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.help-pill { background: var(--teal-soft); color: var(--teal); }
.proj-foot { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); }
.proj-hero-media { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin: 14px 0 6px; background: #000; }
.proj-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }

.footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 28px 0 40px; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer p { margin: 6px 0 0; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; font-size: 14px; }

@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
}
@media (max-width: 640px) {
  .search { display: none; }
  .topnav { gap: 10px; font-size: 14px; }
  .toggle button { padding: 8px 14px; }
  .wordmark { font-size: 18px; }
  .beta { display: none; }
}
@media (max-width: 480px) {
  .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topnav { gap: 14px; font-size: 18px; }
}
@media (max-width: 400px) {
  #owner-link { display: none; }
}

/* Service board */
.svc-price { margin: 4px 0 6px; }
.svc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.svc-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 10px 8px 0; border-bottom: 1px solid var(--border); }
.svc-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.svc-table tr:last-child td { border-bottom: 0; }
.gh-mark { vertical-align: -3px; }
