diff --git a/Ralph/IMPLEMENTATION_PLAN.md b/Ralph/IMPLEMENTATION_PLAN.md index 69c180d..8084092 100644 --- a/Ralph/IMPLEMENTATION_PLAN.md +++ b/Ralph/IMPLEMENTATION_PLAN.md @@ -1,58 +1,88 @@ -# Implementation Plan — React Conversion +# Implementation Plan — Clinical Record PMR System ## Project Overview -Convert the completed `concept.html` (ECG Heartbeat CV Website) into a modern React application with TypeScript, Vite, and Tailwind CSS. The project will be a portfolio-grade React implementation that preserves all animations, interactions, and design details from the HTML concept while following React best practices. +Transform the existing React CV application into a **Patient Medical Record (PMR) system** — a faithful digital clinical information system that presents Andy's CV as a clinician would view a patient record. This is Design 7: The Clinical Record, completely replacing the previous ECG-based design. -**Key Features to Port:** -- Boot sequence with terminal typing animation -- ECG flatline and heartbeat SVG animations -- Branching lines that trace UI elements into existence -- Color transition from green ECG to teal/coral design system -- Floating pill navigation with active section tracking -- SVG circular skill gauges with scroll-triggered animations -- Experience timeline with ECG decoration -- Scroll-reveal animations using IntersectionObserver -- Fully responsive design (desktop/tablet/mobile) +**Core Concept:** +The "patient" is Andy's career. Users navigate a genuine PMR interface (similar to EMIS Web, SystmOne, Vision) with: +- Patient banner with persistent demographic context +- Sidebar navigation with clinical record categories (Summary, Consultations, Medications, Problems, Investigations, Documents, Referrals) +- Consultation-journal format for experience (History/Examination/Plan structure) +- Tabular medications list for skills with proficiency "dosages" +- Clinical alert system for standout achievements +- Light-mode only (authentic to clinical systems) +- Border-heavy, table-heavy, functional aesthetic + +**Key Features:** +- ECG exit animation → Login sequence → PMR interface materialization (~2.7s total transition) +- Animated login screen with typing username/password +- 7 sidebar views with instant content swapping (authentic clinical system behavior) +- Expandable consultation entries with coded entries (SNOMED-style references) +- Sortable medications table with prescribing history expansion +- Traffic-light status system (green/amber/red/gray) +- Clinical alert banner with acknowledge interaction +- Responsive: desktop sidebar → tablet icon-only → mobile bottom nav +- Full keyboard navigation (Alt+1-7 shortcuts) +- Search across all PMR sections with fuse.js **Tech Stack:** - React 18+ with TypeScript - Vite for build tooling - Tailwind CSS for styling -- Framer Motion for complex animations (boot sequence, ECG transitions) -- React Intersection Observer for scroll-triggered animations -- Lucide React for icons (replacing unicode symbols) +- Framer Motion for login animation and transitions +- Lucide React for clinical icons +- fuse.js for fuzzy search **Project Structure:** ``` src/ ├── components/ -│ ├── BootSequence.tsx # Terminal typing animation -│ ├── ECGAnimation.tsx # Flatline, heartbeats, branching -│ ├── FloatingNav.tsx # Pill navigation with active tracking -│ ├── Hero.tsx # About section with vitals -│ ├── Skills.tsx # Skill gauges with SVG circles -│ ├── Experience.tsx # Timeline layout -│ ├── Education.tsx # Education cards -│ ├── Projects.tsx # Project cards with gradient borders -│ ├── Contact.tsx # Contact grid -│ └── Footer.tsx # Footer with ECG decoration +│ ├── BootSequence.tsx # Existing terminal animation (preserved) +│ ├── ECGAnimation.tsx # Modified for PMR transition +│ ├── LoginScreen.tsx # Animated login sequence +│ ├── PMRInterface.tsx # Main PMR layout container +│ ├── PatientBanner.tsx # Full + condensed banner +│ ├── ClinicalSidebar.tsx # Navigation sidebar +│ ├── ClinicalAlert.tsx # Dismissible alert banner +│ ├── Breadcrumb.tsx # Navigation breadcrumb +│ ├── views/ +│ │ ├── SummaryView.tsx # Patient summary landing +│ │ ├── ConsultationsView.tsx # Experience as consultations +│ │ ├── MedicationsView.tsx # Skills as medications +│ │ ├── ProblemsView.tsx # Achievements as problems +│ │ ├── InvestigationsView.tsx# Projects as investigations +│ │ ├── DocumentsView.tsx # Education as documents +│ │ └── ReferralsView.tsx # Contact as referral form +│ ├── ui/ +│ │ ├── ConsultationEntry.tsx # Expandable consultation +│ │ ├── MedicationTable.tsx # Sortable skills table +│ │ ├── ProblemEntry.tsx # Problem list item +│ │ ├── InvestigationEntry.tsx# Investigation result +│ │ └── DocumentEntry.tsx # Document list item ├── hooks/ -│ ├── useScrollReveal.ts # IntersectionObserver for scroll animations -│ └── useActiveSection.ts # Track active nav section -├── lib/ -│ └── utils.ts # Utility functions (skill gauge math) +│ ├── useScrollCondensation.ts # Patient banner scroll behavior +│ └── useSearch.ts # Fuse.js search hook +├── data/ +│ ├── consultations.ts # Experience data +│ ├── medications.ts # Skills data +│ ├── problems.ts # Achievements data +│ ├── investigations.ts # Projects data +│ └── documents.ts # Education data ├── types/ -│ └── index.ts # TypeScript interfaces -├── App.tsx # Main app with boot/ECG/CV phases -├── main.tsx # Entry point -└── index.css # Tailwind + custom CSS variables +│ └── pmr.ts # All PMR TypeScript interfaces +├── lib/ +│ └── utils.ts # Utility functions +├── App.tsx # Phase manager (boot → ecg → login → pmr) +└── index.css # Tailwind + PMR CSS variables ``` **Reference Materials:** -- `References/concept.html` — Complete working HTML implementation with all animations -- `References/CV_v4.md` — Source CV content to populate sections -- `References/ECGVideo/` — Remotion video project with ECG animation patterns +- `designs/07-the-clinical-record.md` — Complete design specification +- `References/CV_v4.md` — Source CV content +- `References/concept.html` — Previous ECG implementation (timing reference only) + +--- ## Quality Checks @@ -60,78 +90,79 @@ src/ - `npm run build` — Production build completes without errors - `npm run lint` — No ESLint errors - `npm run typecheck` — No TypeScript errors -- Open `http://localhost:5173` and verify: - - Boot sequence plays exactly as in concept.html (terminal typing, 4 second duration) - - ECG flatline draws left-to-right - - Three heartbeats animate with increasing amplitude - - Branching lines trace outward on third beat - - Background transitions from black to white - - Final CV design renders with all sections - - Floating pill nav tracks active section on scroll - - Skill gauges animate when scrolled into view - - All hover effects work (card elevation, gradient borders) - - Responsive layouts work at 768px and 480px +- Manual verification: + - Boot sequence plays (4s) → ECG flatlines → Login screen types username/password → PMR interface materializes + - Patient banner condenses on scroll (80px → 48px) + - All 7 sidebar views render correctly with proper data + - Consultation entries expand/collapse with History/Examination/Plan sections + - Medications table sorts correctly by all columns + - Clinical alert appears on Summary view and dismisses with animation + - Search finds content across all sections + - Keyboard shortcuts work (Alt+1-7) + - Responsive layouts work at 1024px, 768px, and 480px - No console errors + - Accessibility: screen reader announces views, tables are navigable + +--- ## Tasks -- [x] **Task 1: Initialize React project with Vite + TypeScript + Tailwind** +- [x] **Task 1: Create PMR data layer and TypeScript types** - Run `npm create vite@latest . -- --template react-ts` to scaffold the project. Install dependencies: `npm install framer-motion lucide-react`. Initialize Tailwind: `npm install -D tailwindcss postcss autoprefixer && npx tailwindcss init -p`. Configure `tailwind.config.js` with custom colors (teal #00897B, coral #FF6B6B, etc.). Set up `src/index.css` with Tailwind directives and CSS custom properties matching concept.html. + Create `src/types/pmr.ts` with interfaces for: `Patient`, `Consultation` (History/Examination/Plan/CodedEntries), `Medication` (with PrescribingHistory), `Problem` (status, code, outcome), `Investigation` (with results), `Document`, `ReferralForm`. Create `src/data/` directory with files: `consultations.ts` (5 roles from CV_v4.md mapped to consultation format), `medications.ts` (18 skills mapped to medication format with prescribing history), `problems.ts` (8-10 achievements with traffic light status), `investigations.ts` (4 projects with methodology/results), `documents.ts` (MPharm, Mary Seacole, A-Levels, Research). All data must match CV_v4.md exactly with specific numbers (£14.6M, 14,000 patients, etc.). -- [x] **Task 2: Set up project structure and types** +- [ ] **Task 2: Modify ECGAnimation for PMR flatline transition** - Create the folder structure (`components/`, `hooks/`, `lib/`, `types/`). Define TypeScript interfaces in `types/index.ts` for: `Skill` (name, level, category, color), `Experience` (role, org, date, bullets), `Education` (degree, institution, period, detail), `Project` (title, description, link?). Create `lib/utils.ts` with helper function `calculateSkillOffset(level: number, radius: number): number` that returns `2 * Math.PI * radius * (1 - level / 100)`. + Modify `src/components/ECGAnimation.tsx` to change the exit phase. Instead of fading to white and revealing the CV, the animation should: 1) Complete the name tracing as normal, 2) Hold for 300ms, 3) Draw a flatline extending rightward from the name over 300ms (patient monitor flatline visual), 4) Fade entire canvas to black over 200ms, 5) Transition background to dark blue-gray (#1E293B) over 200ms. Emit `onComplete` callback to trigger LoginScreen. Total ECG phase: ~5-6 seconds. Preserve all existing animation timing for heartbeats and letter tracing. -- [x] **Task 3: Build BootSequence component** +- [ ] **Task 3: Build LoginScreen component with typing animation** - Create `components/BootSequence.tsx`. Implement terminal typing animation using Framer Motion or CSS transitions. Display boot lines with correct colors (cyan labels, green values, dim text). Use exact boot text from concept.html: "CLINICAL TERMINAL v3.2.1", "Initialising pharmacist profile...", SYSTEM/USER/ROLE/LOCATION, module loading, [OK] lines, READY. Duration: ~4 seconds. Emit `onComplete` callback when finished. Styling: black background, Fira Code font. + Create `src/components/LoginScreen.tsx`. Dark blue-gray background (#1E293B). Centered white login card (320px wide, 12px radius, subtle shadow). NHS-blue shield icon at top. Username field: types "A.CHARLWOOD" character-by-character (30ms per char, Geist Mono font). Password field: fills with 8 dots (20ms per dot). "Log In" button: NHS blue (#005EB8), full width. After 150ms pause, button shows pressed state (darkens, 100ms), then emits `onComplete` callback. Total login animation: ~1.2s. Respect `prefers-reduced-motion`: with reduced motion, username appears instantly and login completes in ~500ms. -- [x] **Task 4: Build ECGAnimation component** +- [ ] **Task 4: Build PatientBanner component (full and condensed)** - Create `components/ECGAnimation.tsx`. Port the ECG logic from concept.html: - - SVG flatline drawing left-to-right (1000ms) - - Three PQRST heartbeats with increasing amplitude (40px → 60px → 100px) - - Color interpolation: #00ff41 → #00C9A7 → #00897B - - Branching lines from third R peak tracing UI outlines (pill nav, hero, cards) - - Background transition from black to white - - Emit `onComplete` callback when animation finishes - Use Framer Motion for path drawing animations (pathLength). + Create `src/components/PatientBanner.tsx` with two modes. Full banner (80px): patient name "CHARLWOOD, Andrew (Mr)", DOB "14/02/1993", NHS No "221 181 0" (GPhC number formatted), address "Norwich, NR1", phone, email, status "Active" (green dot), badge "Open to opportunities". Action buttons: Download CV, Email, LinkedIn. Condensed banner (48px, sticky after 100px scroll): name, NHS No, status dot, action buttons only. Use `useScrollCondensation` hook with IntersectionObserver. Smooth height transition (200ms). Banner spans full viewport width. -- [x] **Task 5: Build FloatingNav component** +- [ ] **Task 5: Build ClinicalSidebar component with navigation and search** - Create `components/FloatingNav.tsx`. Floating pill navigation bar fixed at top center. Links: About, Skills, Experience, Education, Projects, Contact. Active link tracking via `useActiveSection` hook (IntersectionObserver). Smooth scroll to sections on click. Responsive: horizontal scroll on mobile. Styling: white bg, rounded-full, shadow-md, teal active state with dot indicator. + Create `src/components/ClinicalSidebar.tsx`. 220px width (desktop), dark blue-gray (#1E293B) background. Header: "CareerRecord PMR v1.0.0". 7 navigation items with Lucide icons: Summary (ClipboardList), Consultations (FileText), Medications (Pill), Problems (AlertTriangle), Investigations (FlaskConical), Documents (FolderOpen), Referrals (Send). Active state: 3px NHS blue left border, white background tint. Separator line after Summary. Footer: "Session: A.CHARLWOOD" and current time. Search input in header with fuse.js integration. Clicking item updates active view instantly (no animation). URL hash updates (#summary, #consultations, etc.). -- [x] **Task 6: Build Hero section component** +- [ ] **Task 6: Build SummaryView component with clinical alert** - Create `components/Hero.tsx`. Port hero section from concept.html: centered layout, name (clamp 36-52px), job title (muted), location pill (teal border), summary paragraph (max-width 560px). Four vital sign metric cards in a row: "10+ Years Experience", "Python/SQL/BI Analytics Stack", "Pop. Health Focus Area", "NHS N&W System". Cards have teal border-top, hover elevation. Responsive: 2x2 grid on tablet, stacked on mobile. + Create `src/components/views/SummaryView.tsx`. Grid layout with cards: Patient Demographics (full width, two-column key-value table), Active Problems (left column, green/amber dots with dates), Current Medications Quick View (right column, 4-column table showing top 5 skills), Last Consultation preview (full width, truncated to 2-3 lines with "View Full Record" link). Clinical Alert banner: amber background (#FEF3C7), amber left border, warning icon, text "ALERT: This patient has identified £14.6M in prescribing efficiency savings...", Acknowledge button. Alert slides down with spring animation (250ms) after view loads. Clicking Acknowledge: icon changes to green checkmark (200ms), then alert collapses upward (200ms). -- [x] **Task 7: Build Skills section with SVG gauges** +- [ ] **Task 7: Build ConsultationsView with History/Examination/Plan structure** - Create `components/Skills.tsx`. Three skill categories: Technical (8 skills, teal), Clinical (6 skills, coral), Strategic (4 skills, teal). Each skill has circular SVG progress gauge using calculated stroke-dashoffset. Scroll-triggered animation: gauges fill when section enters viewport, staggered by 100ms. Port all 18 skills with correct percentages from concept.html. + Create `src/components/views/ConsultationsView.tsx`. Reverse-chronological journal of 5 roles. Each entry: collapsed state shows date, organization (NHS blue), role title, key coded entry, expand chevron. Click to expand: shows Duration, HISTORY section (context/background), EXAMINATION section (bullet list of analysis/findings), PLAN section (bullet list of outcomes), CODED ENTRIES (SNOMED-style codes like [EFF001], [ALG001]). Section headers styled as clinical consultation dividers (uppercase, letter-spacing). Only one entry expanded at a time. Color-coded left border: NHS blue for NHS N&W ICB, Teal (#00897B) for Tesco PLC. Expand animation: height 0→auto (200ms, ease-out). -- [x] **Task 8: Build Experience section with timeline** +- [ ] **Task 8: Build MedicationsView with sortable table and prescribing history** - Create `components/Experience.tsx`. Vertical timeline with 5 roles: Interim Head (May-Nov 2025), Deputy Head (Jul 2024-Present), High-Cost Drugs (May 2022-Jul 2024), Pharmacy Manager (Nov 2017-May 2022), Duty Pharmacy Manager (Aug 2016-Nov 2017). Decorative ECG waveform SVG beside heading. Timeline dot filled for current roles. Cards with hover effect (scale, shadow, left border). Responsive: hide timeline line on mobile, stack cards. + Create `src/components/views/MedicationsView.tsx`. Three category tabs: Active Medications (technical skills), Clinical Medications (healthcare domain skills), PRN (strategic skills). Each tab shows a table: Drug Name | Dose (%) | Frequency | Start | Status. Sortable columns: clicking header sorts (asc/desc toggle). Default sort: by category grouping. Table styling: gray-200 borders, alternating row colors, 40px row height. Hover: subtle blue tint (#EFF6FF). Click row to expand "Prescribing History" — mini-timeline showing skill progression (year + description). History styled in Geist Mono. 18 total medications mapped from CV skills with accurate proficiency percentages and usage frequencies. -- [x] **Task 9: Build Education, Projects, Contact sections** +- [ ] **Task 9: Build ProblemsView with traffic light system** - Create `components/Education.tsx`, `components/Projects.tsx`, `components/Contact.tsx`. - - **Education:** 2-column grid. MPharm (Hons) UEA 2011-2015 (2:1). Mary Seacole Leadership Programme 2018. Gradient top border (teal→coral). A-Levels line below. - - **Projects:** 2x2 grid. PharMetrics (with link), Patient Pathway Analysis, Blueteq Generator, NMS Video. Gradient border hover effect. - - **Contact:** 4-column grid. Phone, Email, LinkedIn, Location. Use Lucide icons (Phone, Mail, Linkedin, MapPin). Responsive: 2x2 on mobile. + Create `src/components/views/ProblemsView.tsx`. Two sections: Active Problems and Resolved Problems. Table columns: Status (traffic light dot), Code (SNOMED-style in Geist Mono), Problem description, Since/Resolved date, Outcome (for resolved). Traffic lights: 8px circles — green (resolved/current), amber (in progress), gray (inactive/historical). Active problems: £220M budget oversight, SQL transformation, data literacy programme. Resolved problems: 8 achievements with specific outcomes ("Python algorithm: 14,000 pts, £2.6M/yr", "70% reduction, 200hrs saved", etc.). Click row to expand full narrative with "linked consultations" navigation. -- [x] **Task 10: Build Footer component and main App.tsx** +- [ ] **Task 10: Build InvestigationsView with results panel** - Create `components/Footer.tsx`. Decorative ECG waveform SVG, attribution text. Update `App.tsx` to orchestrate the three phases: 1) BootSequence (4s), 2) ECGAnimation (4s), 3) CV Content (with all sections). Use React state to track current phase. Ensure smooth transitions between phases. + Create `src/components/views/InvestigationsView.tsx`. Projects presented as diagnostic investigations. Table: Test Name | Requested | Status | Result. Status badges: Complete (green dot), Ongoing (amber dot), Live (pulsing green dot for PharMetrics). 5 investigations: PharMetrics Interactive Platform, Patient Switching Algorithm, Blueteq Generator, CD Monitoring System, Sankey Chart Analysis Tool. Click row to expand "results panel" with tree-indented structure: Date Requested, Date Reported, Status, Requesting Clinician, Methodology, Results, Tech Stack. PharMetrics has "View Results" button linking to medicines.charlwood.xyz. -- [x] **Task 11: Implement scroll animations and responsive design** +- [ ] **Task 11: Build DocumentsView for education/certifications** - Create `hooks/useScrollReveal.ts`. IntersectionObserver-based hook for scroll-triggered section reveals. Add scroll-reveal animations to all sections (opacity 0→1, translateY 24px→0). Ensure animations only trigger once. Add responsive breakpoints: tablet (768px), mobile (480px). Test all layouts. + Create `src/components/views/DocumentsView.tsx`. Education presented as attached documents. Table: Type (icon), Document, Date, Source. Icons: FileText (certificates), Award (registrations), GraduationCap (academic), FlaskConical (research). 4 documents: MPharm (Hons) 2:1 UEA 2015, GPhC Registration 2016, Mary Seacole Programme 2018, A-Levels 2011 + Drug Delivery Research. Click to expand "preview" panel with tree-indented details: Type, Date Awarded, Institution, Classification, Duration, Research details, Notes. Consistent with Investigations expanded view style. -- [x] **Task 12: Final integration, testing, and polish** +- [ ] **Task 12: Build ReferralsView with clinical referral form** - Run all quality checks. Verify TypeScript compiles without errors. Verify no console errors. Test boot sequence timing matches concept.html (~4s). Test ECG animation timing and easing. Verify all CV content accuracy against CV_v4.md. Test all interactive elements (nav, hover effects, scroll animations). Verify responsive layouts at all breakpoints. Final build test. + Create `src/components/views/ReferralsView.tsx`. Contact presented as clinical referral form. Form fields: Referring to (pre-filled: CHARLWOOD, Andrew), NHS Number (pre-filled), Priority toggle (radio: Urgent [red], Routine [blue/selected], Two-Week Wait [amber] with tongue-in-cheek tooltips), Referrer Name/Email/Org inputs, Reason for Referral textarea, Contact Method radio (Email/Phone/LinkedIn). Submit button: NHS blue, full width right half. On submit: loading spinner, then success message with reference number (REF-2026-0210-001 format). Below form: Direct Contact table with Email, Phone, LinkedIn, Location as clickable links. + +- [ ] **Task 13: Implement keyboard shortcuts and accessibility** + + Add keyboard navigation throughout. Global shortcuts: Alt+1-7 activate sidebar items, Escape closes expanded items/menus, / focuses search. Sidebar: Up/Down arrows navigate items, Enter activates. Implement focus management: after login, focus moves to first sidebar item; after view change, focus moves to view heading; after expanding item, focus moves to content. Add ARIA: `role="navigation"` on sidebar, `aria-current="page"` on active item, `role="alert"` on clinical alert, proper table markup with `scope="col"`, `aria-expanded` on expandable items. Test with screen reader: views announced, tables navigable, alert read immediately. + +- [ ] **Task 14: Implement responsive design (tablet and mobile)** + + Tablet (768-1024px): Sidebar collapses to 56px icon-only with tooltips on hover. Patient banner always condensed (48px). Tables may horizontally scroll with indicator. Mobile (<768px): Sidebar becomes bottom navigation bar (56px height, 7 icon buttons, safe area padding). Patient banner becomes minimal top bar. Tables switch to card layout (each row becomes stacked card). Search moves to top of each view. Add back navigation arrow in each view. Test all breakpoints: desktop (>1024), tablet (768-1024), mobile (<768). Ensure touch targets minimum 48px. Test on actual mobile device or emulator. + +- [ ] **Task 15: Final integration, testing, and polish** + + Wire up App.tsx with three phases: BootSequence (4s) → ECGAnimation (modified for flatline) → LoginScreen (1.2s) → PMRInterface. Ensure smooth transitions between phases. Run all quality checks. Verify TypeScript strict mode (no `any` types). Verify all CV content accuracy against CV_v4.md (dates, numbers, achievements). Test all interactive elements: sidebar nav, consultation expand, medication sort, alert acknowledge, referral form submit. Verify responsive layouts at all breakpoints. Test accessibility with keyboard navigation and screen reader. Verify search finds content across all sections. Final production build test. diff --git a/Ralph/progress.txt b/Ralph/progress.txt index 3e82ff2..dd1a62e 100644 --- a/Ralph/progress.txt +++ b/Ralph/progress.txt @@ -1,263 +1,85 @@ -# Progress Log — React Conversion Phase +# Progress Log — Clinical Record PMR Phase + +## Phase Transition + +**Previous phase completed:** React conversion of ECG Heartbeat CV (all 12 tasks done) +**New phase started:** Clinical Record PMR System — Design 7 implementation +**Date:** 2026-02-11 + +This is a complete redesign of the CV presentation, moving from the ECG animation concept to a Patient Medical Record system interface. All previous components (Hero, Skills, Experience, etc.) will be replaced with PMR-specific views and components. ## Codebase Patterns -- **Source of truth**: `References/concept.html` contains the complete working HTML implementation. All animations, timing, colors, and styling must be preserved exactly when porting to React. -- **Tech stack**: React 18+, TypeScript, Vite, Tailwind CSS, Framer Motion, Lucide React -- **Project structure**: Components in `src/components/`, hooks in `src/hooks/`, types in `src/types/`, utilities in `src/lib/` -- **Animation approach**: Framer Motion for complex sequences (boot, ECG), CSS transitions for simple hover effects, IntersectionObserver (via hook) for scroll-triggered animations -- **SVG animations**: Use Framer Motion's `pathLength` prop for drawing effects, or CSS `stroke-dasharray`/`stroke-dashoffset` for skill gauges -- **Skill gauge math**: `circumference = 2 * Math.PI * radius`, `strokeDashoffset = circumference * (1 - level / 100)`, rotate -90deg to start from top -- **Boot sequence timing**: 14 lines × 220ms = ~3080ms, plus 400ms pause, 800ms fade = ~4.28s total -- **ECG timing**: Flatline 1000ms + 3 beats × 600ms + holds 300ms + branching 1500ms + fade 500ms = ~5.5s -- **Color palette**: - - ECG phase: #000 (black), #00ff41 (green), #00e5ff (cyan), #3a6b45 (dim green) - - Final design: #00897B (teal), #FF6B6B (coral), #0F172A (heading), #334155 (text), #94A3B8 (muted) -- **Fonts**: Fira Code (boot), Plus Jakarta Sans (primary), Inter Tight (secondary) -- **Responsive breakpoints**: 768px (tablet), 480px (mobile) + +### PMR Design System +- **Source of truth**: `designs/07-the-clinical-record.md` — Complete specification for the PMR interface +- **Color palette (light-mode only)**: + - Main content: `#F5F7FA` (cool light gray) + - Cards: `#FFFFFF` (white) + - Sidebar: `#1E293B` (dark blue-gray) + - Patient banner: `#334155` (lighter blue-gray) + - NHS blue: `#005EB8` (primary interactive) + - Green: `#22C55E` (active/resolved) + - Amber: `#F59E0B` (alerts/in-progress) + - Red: `#EF4444` (urgent) + - Borders: `#E5E7EB` (gray-200) +- **Typography**: Inter for general text, Geist Mono for coded entries/data values +- **Spacing**: 4px base unit, tighter than previous design (clinical system density) +- **Borders**: 1px solid gray-200, 4px radius (clinical systems use minimal rounding) +- **Table rows**: 40px height, alternating colors + +### Data Architecture +- All PMR content lives in `src/data/` as typed arrays +- Separation of data from components enables easy CV updates +- Types defined in `src/types/pmr.ts` + +### Animation Approach +- **Login typing**: `setInterval` with character-by-character reveal (30ms/char username, 20ms/dot password) +- **View switching**: Instant (no animation) — matches clinical system behavior +- **Consultation expand**: Height 0→auto, 200ms, ease-out +- **Alert entrance**: Slide down with spring, 250ms +- **Alert dismiss**: Icon → checkmark (200ms) → collapse (200ms) +- **Patient banner condensation**: Smooth height transition, 200ms +- **Reduced motion**: Typing instant, slides become fades, expand instant + +### Clinical System Authenticity +- Navigation is instant — no crossfade +- Tables use explicit borders on all cells +- Traffic lights are 8px circles with text labels (never sole indicator) +- Consultation format: History / Examination / Plan (clinical SOAP note structure) +- Medications table mimics actual prescribing lists +- Coded entries use [XXX000] format (SNOMED-style) + +### Responsive Breakpoints +- Desktop (>1024px): 220px sidebar, full tables +- Tablet (768-1024px): 56px icon-only sidebar, scrollable tables +- Mobile (<768px): Bottom nav bar, card layouts instead of tables + +### Accessibility Requirements +- Tables must be proper `