## Sendcloud Theme — Notes (Research & Implementation)

### Overview
Goal: emulate the look and feel of the Sendcloud website so the BuzzTrail widget blends in seamlessly when embedded.

- Use local fonts/icons already downloaded in `shared/themes/sendcloud/assets/`
- Apply theme via `applyTheme('sendcloud')` (see `chatbot/src/main.ts`)
- Tokens are defined in `shared/themes/sendcloud/tokens.ts`
- Font injection handled by `shared/styles/theme-loader.ts` (prevents duplicates)

### References
- Site baseline: [sendcloud.com](https://www.sendcloud.com/)
- Local assets (use these, not remote CDNs, for stable dev/CSP):
  - Fonts: `Aeonik-Regular.woff2`, `Aeonik-Bold.woff2`, `OpenSans-Regular.woff`
  - Font Awesome subsets: `free-fa-solid-900.woff2`, `free-fa-brands-400.woff2`, `free-fa-v4compatibility.woff2`, `fontawesome-webfont.woff`
  - IcoMoon: `icomoon.woff`

### What matching means (for widget UI)
- Typography: families, weights, sizes, line-heights
- Colors: primary accent, text/dim text, subtle bg, border greys
- Spacing: consistent 4/8-based rhythm for paddings/gaps
- Radii: rounded corners on cards/inputs/buttons (subtle, not pill)
- Shadows: gentle elevation for panels/modals/cards
- Controls: compact density, small icons (16–20px), subtle borders

### Research checklist (collect via DevTools/screenshots)
- Screenshots (1440/1280 widths): hero, CTAs, cards/feature blocks, forms/inputs, footer
- Colors (hex): primary blue, text color, muted text, bg tints, border greys
- Typography scale: H1–H4 sizes/line-heights/weights; body/small
- Radii: exact border-radius values for cards/inputs/buttons
- Shadows: `box-shadow` tokens for cards/modals/hover states
- Interactions: hover/active/focus for buttons/links/inputs (copy exact CSS)

### Initial token mapping (adjust after sampling)
- Accent: `--bt-color-accent-9: #2563eb` (placeholder)
- Text: `--bt-text: hsl(215 25% 20%)`
- Muted text: `--bt-text-dim: hsl(215 10% 40%)`
- Background: `--bt-bg: #ffffff`; subtle: `--bt-bg-subtle: hsl(215 33% 98%)`
- Border: `--bt-color-border: hsl(215 16% 85%)`
- Radii: `--bt-radius-2: 8px`, `--bt-radius-3: 12px`, `--bt-radius-4: 16px`
- Spacing scale: `4, 8, 12, 16, 24`
- Typography: base/heading `Aeonik`, fallback `Open Sans`, then system-ui

> Replace the above with exact values from the site after CSS sampling.

### Fonts (already wired via tokens)
- Heading/body: `Aeonik` 400/700
- Secondary/fallback: `Open Sans` 400
- Icons: Font Awesome (Free subsets) + `IcoMoon`

### Implementation status
- [x] Theme registered and applied via `applyTheme('sendcloud')`
- [x] Local fonts referenced in `tokens.ts` → injected by theme loader
- [x] Chatbot default set to `sendcloud` (see `chatbot/src/main.ts`)
- [ ] Tune colors/spacing/typography after collecting screenshots/CSS
- [ ] Define hover/active/focus tokens and small component guidelines

### Usage (local dev)
- Open `chatbot/dev/index.html` (preloads fonts, loads widget script)
- The widget shell (launcher/panel) reads CSS variables from the applied theme
- Tavus Conversation uses stock UI for MVP; we can refine chrome and states via tokens

### Notes
- Prefer self-hosted WOFF/WOFF2 for production to avoid CSP/external dependencies
- Keep icons small (16–20px) using `lucide-react` where applicable for a sleek, professional feel

### Screenshot 1 analysis (initial approximations)
From the provided hero/feature grid screenshot:
- Primary accent blue appears in the 500–600 range; sampling suggests ~`#1b66ff` to `#2563eb`. We will start with `#2563eb` and adjust once we sample live CSS.
- Heading weight looks bold but not extra-black → 700 on `Aeonik`.
- Section background is a very light cool grey with bluish tint. Approx `hsl(215 40% 97%–98%)` for subtle panels; keep page background white for the widget shell.
- Card corners ~16px radius; inner “module” corners ~12px; small controls ~8px.
- Card shadow is soft, likely multi-stop; initial token suggestion:
  - `--bt-shadow-card: 0 8px 24px rgba(17, 25, 40, 0.06)`
- Body text color closer to slate/dark-blue: start with `hsl(215 25% 20%)`; dim text around `hsl(215 10% 40%)`.
- Bullet/check icons use green accent for success points; add later as `--bt-color-success: #22c55e` if needed.

Todo after live CSS sampling:
- Confirm exact accent hex, text contrast on subtle backgrounds, and card shadow.
- Measure H1 (approx ~48px), H2 (~32–36px), H3 (~24px) line-heights.
- Validate button padding, icon size (likely 18–20px in large CTAs), and hover colors.

---

## Relevant decisions for the video chatbot (based on raw notes)
Only items that directly impact the video/chatbot UI chrome.

- Radii
  - Outer video container radius: 32px → set as `--bt-radius-video: 32px` (used for full/near-full-screen video frame outline)
  - CTA/button large radius: ~23px (from pseudo-element) → `--bt-radius-button-lg: 23px`

- Typography
  - H2: `44px / 44px`, weight 600 (Aeonik)
  - H3: `23px / 23px`, weight 600 (Aeonik)
  - Body: `14px / 16px` (Aeonik)
  - Action: Buttons/CTAs inherit Aeonik, letter-spacing normal

- Colors
  - Text/base: `rgb(17, 40, 87)` → use for dark text tokens
  - Accent (text highlight within headings): `rgb(13, 156, 255)` → candidate for `--bt-color-accent`
  - CTA hover/overlay layer: `rgb(0, 211, 247)` → candidate for `--bt-color-accent-hover`
  - Subtle backgrounds: keep light cool-grey/blue tint for panels; leave page bg white inside widget

- Motion
  - CTA overlay transition: `0.45s cubic-bezier(0.25, 1, 0.33, 1)` → use for button hover/active animation token

- Spacing (widget scope)
  - Panel header/footer paddings: target `16–24px`
  - Toolbar gaps: `8–10px`; icon size `18–20px`

- What we will NOT adopt (not relevant to widget)
  - Section-level large vertical paddings (25–100px ranges) from the marketing site
  - Column/grid utility classes and phone-specific paddings

If you want, I can encode these into concrete theme variables in `tokens.ts` next:
- `--bt-radius-video: 32px`, `--bt-radius-button-lg: 23px`
- `--bt-color-accent: rgb(13, 156, 255)`, `--bt-color-accent-hover: rgb(0, 211, 247)`
- `--bt-text: rgb(17, 40, 87)`
- Motion token for CTA hover: `--bt-cta-transition: 0.45s cubic-bezier(0.25, 1, 0.33, 1)`

### Screenshot 2 analysis (cards on bluish gradient background)
Relevant to our video/chatbot chrome only.

- Background (section)
  - Very light blue gradient backdrop. For widget contexts that need a panel background, introduce:
    - `--bt-bg-hero: linear-gradient(180deg, rgba(210,226,248,1) 0%, rgba(198,218,244,1) 100%)` (approx; refine after sampling)

- Card containers (three tall rounded blocks)
  - Corner radius is large and rounded-rect, visually close to 28–32px.
    - Use `--bt-card-radius: 28px` for inner cards; our outer video can stay at `--bt-radius-video: 32px`.
  - Border/outline: thin bright-blue stroke around cards (≈ 2px) that reads as a highlight ring.
    - `--bt-card-border-width: 2px`
    - `--bt-card-border-color: rgb(13, 156, 255)` (same accent family; refine if needed)
  - Background: deep navy-to-slightly-lighter vertical gradient.
    - `--bt-card-bg: linear-gradient(180deg, rgba(16,36,81,1) 0%, rgba(13,45,115,1) 100%)` (approx)
  - Shadow: soft lift; minimal spread.
    - `--bt-card-shadow: 0 8px 24px rgba(0,0,0,0.12)`

- Card typography/colors
  - Titles in white, semi-bold (≈ 600–700). Body copy white with reduced opacity.
    - `--bt-card-text: #ffffff`
    - `--bt-card-text-dim: rgba(255,255,255,0.72)`
  - Iconography appears white/outline; keep small/clean.
    - `--bt-card-icon-size: 20px`

- Spacing
  - Internal padding feels generous (≈ 24–32px). We’ll standardize for our panels:
    - `--bt-card-padding: 28px`
    - Column gap between cards ≈ 40–48px (widget can map to layout gap tokens if needed).

- Application to video chatbot
  - Video toolbar and side info panel can use the card treatment:
    - Toolbar bg: `var(--bt-card-bg)`; text/icons white; border ring `var(--bt-card-border-color)`
    - Toolbar radius: `--bt-card-radius` (28px)
    - Panel padding: `--bt-card-padding`
  - Keep outer video frame at `--bt-radius-video: 32px` for continuity with large containers.

Todo after exact CSS sampling:
- Replace gradient stops with precise hex/hsl from site
- Confirm border color vs glow effect and adjust shadow accordingly

### Screenshot 3 analysis (centered heading + paragraph copy)
Relevant bits to apply to our widget’s info/empty states and small panels.

- Heading block
  - Centered H2 with accent span on the second line.
    - Use H2: `44px/44px`, weight 600 (Aeonik)
    - Accent span color → `--bt-color-accent: rgb(13, 156, 255)` (pending precise sampling)
    - Letter-spacing normal
  - Spacing below heading to body: ~16–20px → `--bt-heading-gap: 20px`

- Body paragraph copy
  - Multi-line paragraph constrained to a readable width with generous line-height.
    - Base size: `14px`; line-height: `22–24px` in practice (increase from 16 for readability in blocks)
    - Tokenize: `--bt-body-size: 14px`; `--bt-body-leading: 22px`
    - Text color: dark blue `rgb(17, 40, 87)` → `--bt-text: rgb(17,40,87)`; dim text 0.75 opacity for secondary lines
    - Recommended measure (max text width): `--bt-measure: 68ch`

- Section/layout spacing
  - Vertical rhythm between heading + paragraph + content cards appears 24–40px.
    - Tokens: `--bt-section-gap-sm: 24px`, `--bt-section-gap-md: 32px`, `--bt-section-gap-lg: 40px`

- Links within headings/body
  - Inline link/accent text uses the same bright blue accent with no underline by default.
    - Use `--bt-link: var(--bt-color-accent)`; hover may darken slightly

- Device/card thumbnails (bottom row)
  - Rounded device frames with sizable radius (visually ~24–28px) and subtle highlight ring.
    - If used in widget previews, map to: `--bt-thumb-radius: 24px`; border `1.5px` with `--bt-card-border-color`

Application to the chatbot UI
- Use this style for modal titles, empty states, and settings panels.
- Keep the conversation/video area focused on the larger radii decisions from earlier (`--bt-radius-video: 32px`) while info text follows these type/spacing tokens.

### Screenshot 4 analysis (enterprise section: dark section, tiles, gradient CTAs)
Only bits that help style our video/chatbot UI.

- Dark section background
  - Deep navy backdrop for contrast with cyan accents.
    - Token: `--bt-bg-section-dark: rgb(18, 34, 64)` (approx); text on dark uses white
    - Secondary decorative circles/gradients are non-essential for the widget → omit

- Tiles/cards on dark
  - Rounded-rect tiles with subtle accent outline and soft shadow.
    - Radius for tiles: `--bt-tile-radius: 20px` (keep `--bt-card-radius: 28px` for larger panels; `--bt-radius-video: 32px` outer)
    - Border: `--bt-tile-border-width: 1.5px`; `--bt-tile-border-color: rgba(13,156,255,0.7)`
    - Background: slightly lighter navy than section → `--bt-tile-bg: rgb(20, 46, 92)`
    - Shadow: `--bt-tile-shadow: 0 6px 16px rgba(0,0,0,0.18)`
  - Text on tiles: white headings, body at ~0.80 opacity.
    - `--bt-text-on-dark: #ffffff`; `--bt-text-on-dark-dim: rgba(255,255,255,0.8)`

- CTA buttons (inside tiles)
  - Pill/rounded rectangle with bright cyan→blue gradient, white label, no border.
    - Height seen previously around 56px; large radius ≈ 23px
    - Tokens:
      - `--bt-cta-h-lg: 56px`
      - `--bt-radius-button-lg: 23px`
      - `--bt-cta-text: #ffffff`
      - `--bt-cta-gradient: linear-gradient(90deg, rgb(0,211,247) 0%, rgb(13,156,255) 100%)`
      - `--bt-cta-gradient-hover: linear-gradient(90deg, rgb(0,231,255) 0%, rgb(33,176,255) 100%)`
      - `--bt-cta-transition: 0.45s cubic-bezier(0.25, 1, 0.33, 1)`
      - `--bt-cta-press-scale: 0.98`

- Logos/brand strip
  - Mono/light logos on dark, ~0.8 opacity.
    - `--bt-logo-opacity: 0.8`

Application to the chatbot UI
- Provide a “dark” toolbar/panel variant using `--bt-bg-section-dark`, tiles for settings cards with `--bt-tile-*` tokens, and gradient CTAs for primary actions.
- Keep the main video frame shape at `--bt-radius-video: 32px` and use gradient CTAs for “Start/End/Resume” where suitable.

---

## Consolidated theme extraction (based on latest guidance)
Focus: only what impacts the video chatbot UI.

### Palette (proposed targets)
- Primary sky blue (hero/active/highlights): `#00B0FF`
  - `--bt-color-accent: #00B0FF`
- Deep navy (buttons/nav/dark sections): `#003366`
  - `--bt-color-navy: #003366`
- Background: `#FFFFFF`
  - `--bt-bg: #FFFFFF`
- Text (near-black): `#222222`
  - `--bt-text: #222222`; dim: `rgba(34,34,34,0.72)`

Note: We still keep earlier Sendcloud approximations (cyan/blue gradients) for CTAs as optional variants; this section sets the baseline tokens.

### Radii
- General UI radius (buttons, inputs, small panels): 8–12px
  - `--bt-radius-sm: 8px`
  - `--bt-radius-md: 12px`
- Large containers (video frame outline): keep `--bt-radius-video: 32px`

### Shadows (minimal)
- Use soft, subtle shadows sparingly
  - `--bt-shadow-soft: 0 0 8px rgba(0,0,0,0.10)`
  - `--bt-shadow-overlay: 0 6px 24px rgba(0,0,0,0.14)`

### Typography
- Sans-serif: continue with `Aeonik` (project-local), but scale targets:
  - Body: 16px base, comfortable reading
    - `--bt-body-size: 16px`; `--bt-body-leading: 24px`
  - Headings (widget scope):
    - H2: 32px–36px, semi-bold (600) for modal titles/sections
    - H3: 20–24px, semi-bold (600)

### Spacing
- Maintain generous, consistent spacing
  - `--bt-space-1: 4px`, `--bt-space-2: 8px`, `--bt-space-3: 12px`, `--bt-space-4: 16px`, `--bt-space-5: 24px`, `--bt-space-6: 32px`, `--bt-space-7: 40px`

### Buttons & interactive elements
- Shape: rounded-rect (use `--bt-radius-md` by default)
- Navy-filled primary or sky-blue gradient variant; subtle hover/press feedback
  - Colors
    - `--bt-button-bg: var(--bt-color-navy)`
    - `--bt-button-bg-hover: #0a3d80` (navy lighten/darken by ~8–12%)
    - `--bt-button-text: #FFFFFF`
  - Motion
    - `--bt-cta-transition: 0.2s ease-out`
    - `--bt-cta-press-scale: 0.98`

### Widget mapping
- Video shell: `--bt-radius-video: 32px`; border optional (1–2px) using `--bt-color-accent`
- Toolbar: navy background (`--bt-color-navy`), white icons/text, radius `--bt-radius-md`, soft shadow `--bt-shadow-soft`
- Settings/tiles: radius `--bt-radius-md`; minimal shadow; borders optional with low-contrast grey
- CTAs: navy default; optional sky-blue gradient for primary action

### To reconcile
- Earlier notes used cyan/blue gradients and dark navy cards; keep as alternates. These consolidated tokens create a clean baseline aligned to the latest guidance (sky blue + deep navy, minimal shadows, 8–12px radii, 16px body). We can decide per context (extension vs embed) which variant to apply.
