/* ═══════════════════════════════════════════════════════════════
   Shared site chrome — nav, buttons, sections, AI chatbox.
   All styling reads from theme tokens in themes.css.
   ═══════════════════════════════════════════════════════════════ */

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

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.h-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.h-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.4rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  transition: background .18s, color .18s, transform .12s, border-color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--bg); }
.btn-primary:hover { background: var(--brand-dk); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); padding: .65rem .9rem; }
.btn-ghost:hover { background: var(--surface-2); }

/* ── Placeholder imagery ── */
.placeholder-img {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      var(--surface-2) 0 14px,
      color-mix(in oklab, var(--surface-2) 80%, var(--text) 8%) 14px 15px);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  overflow: hidden;
}
.placeholder-img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, color-mix(in oklab, var(--bg) 80%, transparent) 100%);
  pointer-events: none;
}
.placeholder-img span { position: relative; z-index: 1; padding: .4rem .7rem; background: var(--surface); border: 1px solid var(--border); }

/* ── AI Chatbox (theme-driven) ── */
.ai-chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px color-mix(in oklab, var(--brand) 40%, transparent);
  transition: transform .2s;
}
.ai-chat-launcher:hover { transform: scale(1.06); }

.ai-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 40px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px color-mix(in oklab, var(--text) 18%, transparent);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: var(--font-body);
}
.ai-chat-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
}
.ai-chat-avatar {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--brand); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.ai-chat-title { font-family: var(--font-display); font-size: 16px; font-weight: 500; line-height: 1.1; }
.ai-chat-sub { font-size: 11px; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.ai-chat-close { margin-left: auto; color: var(--text-dim); padding: 6px; border-radius: 6px; }
.ai-chat-close:hover { background: var(--surface-2); color: var(--text); }

.ai-chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in oklab, var(--brand) 8%, transparent) 0%, transparent 60%),
    var(--surface);
}
.ai-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.45;
}
.ai-msg-bot {
  background: var(--surface-2);
  color: var(--text);
  border-top-left-radius: 4px;
  align-self: flex-start;
}
.ai-msg-user {
  background: var(--brand);
  color: var(--bg);
  border-top-right-radius: 4px;
  align-self: flex-end;
}
.ai-chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 16px 12px;
}
.ai-chip {
  font-size: 12px;
  padding: 7px 11px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background .15s, border-color .15s;
}
.ai-chip:hover { background: var(--surface-2); border-color: var(--text-dim); }

.ai-chat-input {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
}
.ai-chat-input input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.ai-chat-input input:focus { outline: none; border-color: var(--brand); }
.ai-chat-send {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.ai-chat-send:hover { background: var(--brand-dk); }

/* ── Theme indicator badge (top-right of each artboard) ── */
.theme-badge {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 7px;
}
.theme-badge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
}

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .container { padding: 0 20px; } }
