# 📘 Synctonic CSS — The Complete Master Course
### The Definitive Guide to Architecture, Liquid Glass Physics, and Enterprise Component Engineering

> **Welcome to the Synctonic CSS Master Course.**  
> Whether you're an experienced frontend architect or a creative designer-developer, this course will take you from the foundational physics of optical light refraction to building production-ready, hyper-realistic liquid glass user interfaces.
> 
> Synctonic CSS is not just another utility library. It is a **universal, zero-specificity design system** engineered with physical dual-specular caustics, an 8-theme runtime engine, 60fps pointer light tracking, and complete framework neutrality — all compressed into under 12KB.

---

## 🧭 Course Syllabus & Roadmap

1. [Module 1: The Optical Physics of Liquid Glass — Why Most Glassmorphism Looks Fake](#module-1-the-optical-physics-of-liquid-glass)
2. [Module 2: Zero-Specificity Architecture (`:where()`) — The "No-Fight" CSS Philosophy](#module-2-zero-specificity-architecture-where)
3. [Module 3: The Design Token System (`--sync-*`) — Total Visual Control](#module-3-the-design-token-system---sync-)
4. [Module 4: The 5-Tier Glass Material Hierarchy & Optical Shaders](#module-4-the-5-tier-glass-material-hierarchy--optical-shaders)
5. [Module 5: Component Encyclopedia — Deep Architectural Walkthroughs](#module-5-component-encyclopedia)
   - [5.1 Liquid Glass Capsule Buttons](#51-liquid-glass-capsule-buttons)
   - [5.2 Floating Dynamic Island Navigation](#52-floating-dynamic-island-navigation)
   - [5.3 Bento Grid & Interactive Cards](#53-bento-grid--interactive-cards)
   - [5.4 visionOS Floating Dock](#54-visionos-floating-dock)
   - [5.5 Glass Code Windows & Terminal Viewers](#55-glass-code-windows--terminal-viewers)
   - [5.6 Liquid Glass Chat Engine](#56-liquid-glass-chat-engine)
   - [5.7 Form Physics, Floating Labels & Tactile Controls](#57-form-physics-floating-labels--tactile-controls)
   - [5.8 SaaS Pricing Tiers & Feature Matrix](#58-saas-pricing-tiers--feature-matrix)
   - [5.9 Spotlight Command Palette (`Cmd + K`)](#59-spotlight-command-palette-cmd--k)
   - [5.10 Overlays: Modals, Toasts, Dropdowns & Tooltips](#510-overlays-modals-toasts-dropdowns--tooltips)
6. [Module 6: The 8-Theme Material Engine & Dark/Light Modes](#module-6-the-8-theme-material-engine--darklight-modes)
7. [Module 7: Interactive 3D Cursor Light-Tracking (`synctonic.js`)](#module-7-interactive-3d-cursor-light-tracking-synctonicjs)
8. [Module 8: The Live In-Browser Glass Lab & Token Generator](#module-8-the-live-in-browser-glass-lab--token-generator)
9. [Module 9: Production Integration (React, Next.js, Vue, Svelte, Vanilla)](#module-9-production-integration-react-nextjs-vue-svelte-vanilla)
10. [Module 10: Performance, Accessibility (a11y) & Troubleshooting](#module-10-performance-accessibility-a11y--troubleshooting)

---

## Module 1: The Optical Physics of Liquid Glass

### The Problem: Why Flat "Glassmorphism" Fails

For years, web tutorials taught glassmorphism as two simple CSS declarations:
```css
/* ❌ The "Fake Glass" Anti-Pattern */
.fake-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}
```

When applied to a webpage, this looks like **milky plastic or foggy grease**. Why? Because in the real world, glass is not a flat translucent rectangle. Real optical lenses (like the curved glass on an Apple Vision Pro, an iPhone camera lens, or a drop of water) interact with light in four distinct physical ways:

```
┌────────────────────────────────────────────────────────────────────────┐
│  LAYER 1: Specular Crest Seam (Incident light reflection highlight)   │
├────────────────────────────────────────────────────────────────────────┤
│  LAYER 2: Translucent Convex Body (Blur + Color Saturation Boost)      │
│           • Chromatic dispersion & spectral thin-film refraction       │
├────────────────────────────────────────────────────────────────────────┤
│  LAYER 3: Inner Lens Bevel (Double-inset caustic glow & depth)         │
├────────────────────────────────────────────────────────────────────────┤
│  LAYER 4: Multi-Stop Ambient Occlusion Shadow (Soft diffuse drop)      │
└────────────────────────────────────────────────────────────────────────┘
```

$$\\text{Liquid Glass Fidelity} = \\text{Translucency} + \\text{Fresnel Reflection} + \\text{Inner Lens Caustics} + \\text{Chromatic Refraction}$$

---

### The 4 Physical Layers of Synctonic Liquid Glass

#### 1. The Specular Crest Seam (`::before` with XOR Masking)
When light strikes the curved upper rim of a glass capsule, it creates a sharp, bright, concentrated reflection crest. Synctonic achieves this using a hardware-accelerated `::before` pseudo-element with exclusive gradient masking:

```css
.sync-btn-liquid::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    to bottom,
    var(--sync-liquid-highlight-top) 0%,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 50%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
```
* **How it works**: The XOR mask clips the gradient so it ONLY renders on the 1px perimeter border, concentrated at the top edge where incident light strikes.

#### 2. Backdrop Refraction with Optical Saturation Boost
When looking through real glass, colors behind the lens don't just get blurry — they look **richer and more vibrant**. Synctonic boosts backdrop saturation by 180% to 200%:
```css
backdrop-filter: blur(var(--sync-liquid-blur)) saturate(var(--sync-liquid-saturation)) brightness(1.04);
-webkit-backdrop-filter: blur(var(--sync-liquid-blur)) saturate(var(--sync-liquid-saturation)) brightness(1.04);
```

#### 3. Inner Lens Bevels (Caustic Depth)
Real glass has thickness. Synctonic uses dual-inset box-shadows to simulate light bouncing around inside the interior volume:
```css
box-shadow:
  inset 0 1px 1px 0 rgba(255, 255, 255, 0.95),   /* Sharp inner top rim */
  inset 0 0 16px 0 rgba(255, 255, 255, 0.45),    /* Soft diffuse caustic glow */
  var(--sync-liquid-shadow);                     /* Ambient ground shadow */
```

#### 4. Ambient Occlusion Drops
Floating glass objects cast soft, multi-stop diffuse shadows onto the surfaces behind them, creating genuine physical elevation without harsh black silhouettes.

---

## Module 2: Zero-Specificity Architecture (`:where()`)

### The "No-Fight" CSS Philosophy

Have you ever used a CSS framework where you tried to change a button color, but your class didn't work because the framework's internal selector was `html body .main-wrapper .btn-primary`? You were forced to write ugly `!important` tags or match their absurdly specific selectors.

**Synctonic completely eliminates specificity wars.**

Every single default HTML element styling rule in Synctonic is wrapped in the modern **`:where()`** pseudo-class:

```css
/* Zero-Specificity Auto-Styling */
:where(button:not(.sync-no-auto button, .sync-raw button)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  border-radius: var(--sync-radius-full);
  background: var(--sync-liquid-bg);
  border: 1px solid var(--sync-liquid-border);
  font-family: var(--sync-font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--sync-duration-normal) var(--sync-ease-spring);
}
```

### Why This is a Game-Changer:
1. **Specificity of `:where()` is always $(0, 0, 0)$**: It contributes zero weight to the CSS cascade.
2. **Instant Beautiful Defaults**: A plain, bare `<button>Click Me</button>` automatically gets full liquid glass styling out of the box.
3. **Effortless Overrides**: The moment you add *any* class (e.g. `.my-button { background: red; }`), your class wins immediately because $(0, 1, 0) > (0, 0, 0)$! No `!important`, no cascading headaches.

### Escape Hatches
Need to completely bypass auto-styling for a legacy widget or raw unstyled element?
* `class="sync-no-auto"`: Disables automatic glass styling across an entire subtree or container.
* `class="sync-raw"`: Reverts an element back to vanilla browser defaults.

---

## Module 3: The Design Token System (`--sync-*`)

Every visual dimension in Synctonic is exposed as a CSS Custom Property on `:root`. You can override tokens globally in your CSS, locally inside a component, or inline via the `style` attribute.

```css
:root {
  /* Brand Accents */
  --sync-accent: #4f6bff;
  --sync-accent-rgb: 79, 107, 255;
  --sync-accent-2: #8a5cf6;

  /* Liquid Glass Parameters */
  --sync-liquid-bg: rgba(255, 255, 255, 0.55);
  --sync-liquid-border: rgba(255, 255, 255, 0.8);
  --sync-liquid-highlight-top: rgba(255, 255, 255, 0.95);
  --sync-liquid-blur: 24px;
  --sync-liquid-saturation: 1.8;
  --sync-liquid-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);

  /* Fluid Typography Scale (Automated clamp calculation) */
  --sync-text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --sync-text-sm: clamp(0.875rem, 0.84rem + 0.18vw, 0.9375rem);
  --sync-text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --sync-text-lg: clamp(1.125rem, 1.08rem + 0.23vw, 1.25rem);
  --sync-text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --sync-text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --sync-text-3xl: clamp(1.875rem, 1.65rem + 1.1vw, 2.25rem);
  --sync-text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);

  /* Motion & Physics Curves */
  --sync-ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --sync-ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
  --sync-duration-fast: 150ms;
  --sync-duration-normal: 250ms;
  --sync-duration-slow: 400ms;
}
```

> **💡 Pro-Tip**: You can tweak any component's glass look inline without writing new CSS!
> ```html
> <div class="sync-card" style="--sync-liquid-blur: 40px; --sync-liquid-bg: rgba(255,0,128,0.2);">
>   Custom pink heavy frosted card
> </div>
> ```

---

## Module 4: The 5-Tier Glass Material Hierarchy & Optical Shaders

Synctonic provides five mathematically calibrated material tiers, allowing you to establish clear visual depth and hierarchy in your applications:

| Material Class | Blur Radius | Opacity | Physical Metaphor | Recommended Usage |
| :--- | :--- | :--- | :--- | :--- |
| `.sync-glass-clear` | `6px` | ~25% | Polished Window Glass | Subtle overlays, background dividers, ambient panels |
| `.sync-glass-soft` | `10px` | ~45% | Light Mist | Secondary buttons, inactive tabs, badge backgrounds |
| `.sync-glass` | `16px` | ~60% | Standard Frosted Glass | Workhorse UI surface, standard cards, dropdowns |
| `.sync-glass-strong` | `24px` | ~78% | Heavy Crystal | Floating navigation bars, active cards, popovers |
| `.sync-glass-solid` | `32px` | ~92% | Dense Acrylic / Mica | Modals, command palettes, sheets requiring high contrast |
| `.sync-glass-liquid` | `24px` | Dynamic | 3D Curved Lens | Signature hero buttons, featured bento cards, docks |

### Advanced Optical Shaders

Want to take your glass aesthetics into the stratosphere? Synctonic includes three specialized visual shader utility classes:

1. **`.sync-glass-chromatic` (Rainbow Prism Refraction)**:  
   Simulates light dispersion where different wavelengths bend at different angles, creating a subtle, shimmering rainbow rim along the top specular edge.
2. **`.sync-glass-holographic` (Iridescent Sheen)**:  
   Simulates thin-film optical interference, casting a futuristic color-shifting glow over the surface.
3. **`.sync-glass-grain` (Tactile Frosted Texture)**:  
   Applies an ultra-fine, hardware-accelerated SVG turbulence noise texture to simulate physical sandblasted glass.

```html
<!-- Example: A Chromatic Bento Card with Tactile Grain -->
<div class="sync-card sync-glass-strong sync-glass-chromatic sync-glass-grain">
  <h3>Next-Gen Optical Shader</h3>
</div>
```

---

## Module 5: Component Encyclopedia

Here is the complete, exhaustive manual for Synctonic's enterprise component library.

### 5.1 Liquid Glass Capsule Buttons

Buttons in Synctonic are engineered with spring bounce kinematics, specular caustics, and pointer shine reflections.

```html
<!-- Signature 3D Liquid Button with Light Shine -->
<button class="sync-btn-liquid sync-btn-xl sync-btn-shine sync-tilt" data-sync-tilt>
  Synctonic Labs
</button>

<!-- Button Variants -->
<button class="sync-btn sync-btn-primary">Primary Luminous</button>
<button class="sync-btn sync-btn-secondary">Frosted Secondary</button>
<button class="sync-btn sync-btn-ghost">Crystal Ghost</button>
<button class="sync-btn sync-btn-chromatic">Chromatic Rainbow</button>
<button class="sync-btn sync-btn-glow">Ambient Halo</button>

<!-- Segmented Pill Group -->
<div class="sync-btn-group">
  <button class="sync-btn sync-btn-sm sync-active">Day</button>
  <button class="sync-btn sync-btn-sm">Week</button>
  <button class="sync-btn sync-btn-sm">Month</button>
</div>
```

---

### 5.2 Floating Dynamic Island Navigation

The Synctonic navbar is designed as a floating capsule that docks gracefully at the top of the viewport. On mobile devices, it automatically expands into a Windows 11 Acrylic / Command Palette dropdown drawer without layout distortion.

```html
<header class="sync-navbar sync-navbar-floating">
  <div class="sync-flex sync-items-center sync-gap-xs">
    <a href="#" class="sync-navbar-brand">
      <img src="logo.png" alt="Logo" style="height: 28px; width: 28px; border-radius: 50%;">
      <span>Synctonic CSS</span>
    </a>
    <span class="sync-badge sync-badge-primary sync-badge-sm sync-hide-mobile">v0.2.0</span>
  </div>

  <nav class="sync-navbar-menu">
    <div class="sync-navbar-menu-header">
      <span>Navigation</span>
      <span style="font-size: 0.65rem; opacity: 0.7;">v0.2.0</span>
    </div>
    <a href="#innovations" class="sync-nav-link sync-active">
      <span class="sync-nav-link-main">
        <span class="sync-nav-icon">✨</span>
        <span class="sync-nav-text-desktop">Innovations</span>
        <span class="sync-nav-text-mobile">Core Innovations</span>
      </span>
      <kbd class="sync-kbd">↵</kbd>
    </a>
    <a href="#nextgen" class="sync-nav-link">
      <span class="sync-nav-link-main">
        <span class="sync-nav-icon">🚀</span>
        <span class="sync-nav-text-desktop">Next-Gen</span>
        <span class="sync-nav-text-mobile">Next-Gen Suite</span>
      </span>
      <kbd class="sync-kbd">↵</kbd>
    </a>
    <a href="#docs" class="sync-nav-link">
      <span class="sync-nav-link-main">
        <span class="sync-nav-icon">📖</span>
        <span class="sync-nav-text-desktop">Docs</span>
        <span class="sync-nav-text-mobile">Master Course Docs</span>
      </span>
      <kbd class="sync-kbd">↵</kbd>
    </a>
  </nav>

  <div class="sync-navbar-actions">
    <button class="sync-navbar-icon-btn" id="themeModeToggle" title="Toggle Mode">🌙</button>
    <button class="sync-navbar-toggle sync-navbar-icon-btn" aria-label="Toggle navigation">☰</button>
  </div>
</header>
```

---

### 5.3 Bento Grid & Interactive Cards

Bento grids organize complex feature suites into harmonious modular layouts:

```html
<div class="sync-bento-grid">
  <!-- Bento Span 2 (Wide Featured Card) -->
  <div class="sync-card sync-card-liquid sync-bento-span-2 sync-tilt" data-sync-tilt>
    <span class="sync-badge sync-badge-primary">Architecture</span>
    <h3>Zero-Specificity Engineering</h3>
    <p>All semantic rules wrapped in :where() for zero cascade battles.</p>
  </div>

  <!-- Bento Regular Card -->
  <div class="sync-card sync-card-liquid sync-tilt" data-sync-tilt>
    <span class="sync-badge sync-badge-success">Performance</span>
    <h3>&lt;12KB Gzipped</h3>
    <p>100% Zero runtime dependencies.</p>
  </div>
</div>
```

---

### 5.4 visionOS Floating Dock

Inspired by Apple visionOS and macOS, the floating dock features proximity magnification and floating glass tooltip pills:

```html
<div class="sync-dock-container">
  <div class="sync-dock">
    <a href="#" class="sync-dock-item sync-active" data-sync-title="Finder">📁</a>
    <a href="#" class="sync-dock-item" data-sync-title="Terminal">⚡</a>
    <a href="#" class="sync-dock-item" data-sync-title="Studio">🎨</a>
    <div class="sync-dock-divider"></div>
    <a href="#" class="sync-dock-item" data-sync-title="Settings">⚙</a>
  </div>
</div>
```

---

### 5.5 Glass Code Windows & Terminal Viewers

Present code snippets inside a high-end macOS frosted window complete with colored window chrome controls and 1-click clipboard copy:

```html
<div class="sync-codeblock sync-tilt" data-sync-tilt>
  <div class="sync-codeblock-header">
    <div class="sync-codeblock-dots">
      <span class="sync-codeblock-dot dot-red"></span>
      <span class="sync-codeblock-dot dot-yellow"></span>
      <span class="sync-codeblock-dot dot-green"></span>
    </div>
    <span class="sync-codeblock-lang">Terminal Setup</span>
    <button class="sync-codeblock-copy">📋 Copy</button>
  </div>
  <pre class="sync-codeblock-body"><code>npm install synctonic-css</code></pre>
</div>
```

---

### 5.6 Liquid Glass Chat Engine

Create conversational AI and messaging interfaces with speech bubbles that refract background wallpapers:

```html
<div class="sync-chat-container">
  <div class="sync-chat-messages">
    <!-- Received Bubble -->
    <div class="sync-chat-bubble sync-chat-bubble-received">
      How does the liquid glass reflection work?
      <div class="sync-chat-time">10:42 AM</div>
    </div>
    <!-- Sent Bubble -->
    <div class="sync-chat-bubble sync-chat-bubble-sent">
      It layers specular masks with dual-inset caustic glows!
      <div class="sync-chat-time">10:43 AM · Read ✓✓</div>
    </div>
  </div>
</div>
```

---

### 5.7 Form Physics, Floating Labels & Tactile Controls

Forms in Synctonic feature spring focus animations, glass borders, and rich validation states:

```html
<!-- Floating Label Input -->
<div class="sync-form-floating">
  <input type="email" class="sync-input sync-is-valid" placeholder=" " value="user@synctonic.dev">
  <label class="sync-label">Work Email</label>
</div>

<!-- Password Field with Icon and Toggle Eye -->
<div class="sync-input-wrapper">
  <span class="sync-input-icon-left">🔒</span>
  <input type="password" class="sync-input sync-input-has-icon-left sync-input-has-icon-right" value="Secret123">
  <button type="button" class="sync-input-icon-right sync-password-toggle">👁️</button>
</div>

<!-- Tactile Range Slider -->
<div class="sync-slider-container">
  <div class="sync-slider-header">
    <span>Refraction Blur</span>
    <span class="sync-slider-value">24px</span>
  </div>
  <input type="range" class="sync-slider" min="0" max="60" value="24">
</div>

<!-- Glass Switches & Checkboxes -->
<label class="sync-switch">
  <input type="checkbox" checked>
  <span class="sync-switch-track"><span class="sync-switch-thumb"></span></span>
  <span>Ambient Lighting</span>
</label>
```

---

### 5.8 SaaS Pricing Tiers & Feature Matrix

Build conversion-optimized pricing tables with glowing popular tags and crystal borders:

```html
<div class="sync-pricing-grid">
  <div class="sync-pricing-card sync-pricing-popular">
    <span class="sync-badge sync-badge-primary sync-pricing-badge">★ POPULAR</span>
    <h3>Pro Studio</h3>
    <div class="sync-pricing-price">$29 <span>/ month</span></div>
    <ul class="sync-pricing-features">
      <li class="sync-pricing-feature"><span class="sync-pricing-feature-check">✓</span> 8-Theme Runtime Engine</li>
      <li class="sync-pricing-feature"><span class="sync-pricing-feature-check">✓</span> 60fps 3D Cursor Tracking</li>
    </ul>
    <button class="sync-btn sync-btn-primary sync-btn-block sync-btn-shine">Get Started</button>
  </div>
</div>
```

---

### 5.9 Spotlight Command Palette (`Cmd + K`)

A macOS Spotlight / Raycast-style command menu accessible from anywhere in your app:

```html
<div class="sync-command-backdrop" id="commandBackdrop">
  <div class="sync-command-dialog">
    <div class="sync-command-header">
      <span class="sync-command-search-icon">🔍</span>
      <input type="text" class="sync-command-input" placeholder="Type a command or search...">
      <kbd class="sync-kbd">ESC</kbd>
    </div>
    <div class="sync-command-body">
      <div class="sync-command-group">
        <div class="sync-command-group-title">Quick Actions</div>
        <div class="sync-command-item sync-active" onclick="location.href='#innovations'">
          <div class="sync-command-item-main"><span>✨</span><span>Core Innovations</span></div>
          <kbd class="sync-kbd">↵</kbd>
        </div>
      </div>
    </div>
  </div>
</div>
```

---

## Module 6: The 8-Theme Material Engine & Dark/Light Modes

Synctonic features an instant runtime theming engine. Rather than compiling separate CSS files, themes are switched in real-time by toggling data attributes on the `<html>` element:

```html
<!-- Example: Activate Cosmic Nebula Theme in Dark Mode -->
<html lang="en" data-sync-mode="dark" data-sync-theme="nebula">
```

### The 8 Curated Material Palettes

1. **`default` (Cobalt & Electric Purple)**:
   `--sync-accent: #4f6bff;` & `--sync-accent-2: #8a5cf6;`
2. **`midnight` (Obsidian OLED Dark Glass)**:
   Deep black substrate with pure crystal refraction (`#030712`).
3. **`aurora` (Ethereal Teal & Emerald Glow)**:
   `--sync-accent: #06b6d4;` & `--sync-accent-2: #10b981;`
4. **`nebula` (Cyberpunk Magenta & Violet)**:
   `--sync-accent: #d946ef;` & `--sync-accent-2: #8b5cf6;`
5. **`ocean` (Deep Marine Cyan & Sapphire)**:
   `--sync-accent: #0284c7;` & `--sync-accent-2: #2563eb;`
6. **`sunset` (Warm Gold & Radiant Coral)**:
   `--sync-accent: #f59e0b;` & `--sync-accent-2: #f43f5e;`
7. **`rose` (Blush Pink & Ruby Velvet)**:
   `--sync-accent: #ec4899;` & `--sync-accent-2: #f43f5e;`
8. **`emerald` (Electric Lime & Mint Jade)**:
   `--sync-accent: #84cc16;` & `--sync-accent-2: #10b981;`
9. **`mono` (Minimalist Platinum & Charcoal)**:
   Neutral high-contrast monochrome glass.

```javascript
// Toggle themes with 1 line of JavaScript
document.documentElement.setAttribute('data-sync-theme', 'aurora');
document.documentElement.setAttribute('data-sync-mode', 'light');
```

---

## Module 7: Interactive 3D Cursor Light-Tracking (`synctonic.js`)

In the real world, when you tilt a glass object or move your head, the specular reflection shifts across the lens. Synctonic brings this physical behavior to the web with **zero external dependencies** in a **<1.5KB** JavaScript companion engine.

### How to Activate

Simply include `synctonic.js` and add `data-sync-tilt` (or `class="sync-tilt"`) to any button, card, or container:

```html
<button class="sync-btn-liquid sync-btn-xl sync-tilt" data-sync-tilt>
  Specular Interactive Button
</button>

<script src="dist/synctonic.js"></script>
```

### What Happens Under the Hood:
1. **Pointer Coordinate Calculation**: On `pointermove`, `synctonic.js` calculates the cursor's exact angular vector relative to the center of the element.
2. **Dynamic Specular Angle (`--sync-glass-tilt`)**: The angle is dynamically mapped to `--sync-glass-tilt: [deg]` so the top-edge specular highlight rotates to face the light source in real-time.
3. **Internal Spotlight Position (`--sync-mouse-x`, `--sync-mouse-y`)**: Updates internal coordinate percentages for localized light blooming.
4. **Spring Physics on Exit**: When the pointer leaves, the element smoothly decelerates back to $(0, 0)$ rest position using `cubic-bezier(0.34, 1.4, 0.64, 1)`.

---

## Module 8: The Live In-Browser Glass Lab & Token Generator

Synctonic comes with a built-in interactive **Glass Physics Lab** located directly inside the preview application (`preview/index.html#customizer`).

### Physics Parameters You Can Tune Live:
* **Backdrop Blur (`--sync-liquid-blur`)**: Range `0px` to `60px`.
* **Glass Opacity (`--sync-liquid-bg`)**: Range `5%` to `95%`.
* **Saturation Boost (`--sync-liquid-saturation`)**: Range `1.0` to `2.5`.
* **Specular Highlight Intensity (`--sync-liquid-highlight-top`)**: Range `0.2` to `1.0`.
* **Light Incident Angle (`--sync-glass-tilt`)**: Range `0deg` to `360deg`.

### 1-Click Production Token Export
Once you have dialed in your exact custom glass recipe, click **"Copy CSS Tokens"** to generate ready-to-use production CSS:

```css
:root {
  --sync-liquid-bg: rgba(255, 255, 255, 0.55);
  --sync-liquid-border: rgba(255, 255, 255, 0.80);
  --sync-liquid-highlight-top: rgba(255, 255, 255, 0.95);
  --sync-liquid-blur: 24px;
  --sync-liquid-saturation: 1.80;
  --sync-glass-tilt: 135deg;
}
```

---

## Module 9: Production Integration (React, Next.js, Vue, Svelte, Vanilla)

### 1. Installation via Package Managers
```bash
# npm
npm install synctonic-css

# pnpm
pnpm add synctonic-css

# yarn
yarn add synctonic-css
```

### 2. CDN Installation (No Build Step)
```html
<head>
  <!-- Synctonic Liquid Glass CSS (<12KB) -->
  <link rel="stylesheet" href="https://unpkg.com/synctonic-css/dist/synctonic.min.css">
  
  <!-- Interactive 3D Light Engine (<1.5KB) -->
  <script src="https://unpkg.com/synctonic-css/dist/synctonic.js" defer></script>
</head>
```

### 3. React / Next.js Component Example
```jsx
// components/LiquidButton.jsx
import React from 'react';

export function LiquidButton({ 
  children, 
  variant = 'liquid', 
  size = 'md', 
  shine = true, 
  className = '', 
  ...props 
}) {
  const classList = [
    'sync-btn',
    `sync-btn-${variant}`,
    `sync-btn-${size}`,
    shine ? 'sync-btn-shine' : '',
    'sync-tilt',
    className
  ].filter(Boolean).join(' ');

  return (
    <button className={classList} data-sync-tilt {...props}>
      {children}
    </button>
  );
}
```

### 4. Vue 3 Component Example
```vue
<!-- components/LiquidCard.vue -->
<template>
  <div class="sync-card sync-card-liquid sync-tilt" data-sync-tilt>
    <div class="sync-card-header" v-if="$slots.header">
      <slot name="header"></slot>
    </div>
    <div class="sync-card-body">
      <slot></slot>
    </div>
  </div>
</template>
```

---

## Module 10: Performance, Accessibility (a11y) & Troubleshooting

### ⚡ GPU Compositing & 60fps Performance
* Every frosted lens in Synctonic uses `isolation: isolate;` and `will-change: transform;` on hover to promote glass layers to dedicated GPU render buffers.
* Backdrop blur operations are automatically cached by modern rendering engines, preventing full-page repaints during scrolling.

### ♿ Accessibility (a11y) & Motion Preferences
* **`prefers-reduced-motion`**: When a user enables reduced motion in their OS settings, all 3D tilt animations, floating drifts, and continuous shines are automatically deactivated.
* **Color Contrast Guarantee**: High-contrast text tokens ensure WCAG 2.1 AA compliance across all 8 theme palettes in both dark and light modes.
* **Keyboard Navigation (`:focus-visible`)**: Every interactive component features an unmistakable, luminous optical focus ring:
  ```css
  :focus-visible {
    outline: 2px solid var(--sync-accent);
    outline-offset: 3px;
    box-shadow: 0 0 16px rgba(var(--sync-accent-rgb), 0.4);
  }
  ```

---

## 🎓 Congratulations!

You have completed the **Synctonic CSS Master Course**. You are now equipped with the physical principles, architectural mastery, and component knowledge to build breathtaking, high-performance web applications with the world's most advanced liquid glass design system.

* 🌐 **Preview App**: Open `preview/index.html` in your browser.
* 📦 **NPM Package**: `synctonic-css`
* 🛠️ **Source Code**: Explore `src/` for all token, component, and shader definitions.
