# Context for External Reviewer

## What this is
- **Project type:** Design examples for a daily digest web app
- **What it does:** These files demonstrate a clean, minimal card-based UI for displaying curated content from Product Hunt and Reddit
- **Target environment:** PHP backend with vanilla CSS/JS frontend, served via standard web server

## How it's supposed to work
- **Primary flow:** index.php renders a digest page with section headers, card components (featured, link, compact, Product Hunt), and a feedback form
- **Key entrypoints:**
  - `index.php` — Complete page structure with PHP form handler and semantic HTML
  - `styles.css` — Full CSS design system with card variants, typography, and responsive layout
  - `app.js` — Minimal JavaScript for feedback form toggle and dynamic favicon loading

## Design patterns to study

1. **Card component variants** — Multiple card types (`.card--featured`, `.card--link`, `.card--ph`, `.is-compact`) for different content emphasis
2. **CSS custom properties** — Centralized design tokens for colors, spacing, and typography
3. **Semantic HTML structure** — Clean markup with BEM-style class naming
4. **Progressive enhancement** — Works without JS, enhanced with JS for better UX
5. **Favicon fetching** — Dynamic favicon loading via Google's favicon service

## Key CSS patterns
- `.card` base class with modifier variants
- `.content-item` for consistent spacing
- `.source-header` and `.source-tags` for section organization
- Responsive typography with clamp() functions
- Dark/minimal color palette

## Specific focus areas
- Study the card component CSS for reusable patterns
- Note the feedback form progressive disclosure pattern
- Observe the favicon data-attribute system in JS
- See how PHP handles form submission with file persistence

---

# Codebase Export - Selected Files

Exported 3 files.

## Structure

```
digest-archive/2025-12-30/index.php
WEB/css/styles.css
WEB/js/app.js
```

## Files

### digest-archive/2025-12-30/index.php

``````php
<?php
// Feedback form handler - saves suggestions to markdown file
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['suggestion'])) {
    $suggestion = htmlspecialchars(trim($_POST['suggestion']));
    $digestDate = basename(__DIR__);
    $timestamp = date('Y-m-d H:i:s');

    $entry = "\n## From digest: $digestDate\n";
    $entry .= "**Submitted:** $timestamp\n\n";
    $entry .= "$suggestion\n\n---\n";

    // Path: from digest-archive/date/ to project root
    file_put_contents(__DIR__ . '/../../SUGGESTIONS-FROM-USER.MD', $entry, FILE_APPEND | LOCK_EX);
    $submitted = true;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Digest — Dec 30, 2025</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="../../WEB/css/styles.css">
    <link rel="icon" type="image/png" href="../../WEB/assets/favicon.png">
</head>
<body>
    <div class="container">
        <div class="main-card">

            <header class="page-header content-item">
                <span class="page-header__date">December 30, 2025</span>
                <span class="page-header__credits">AI-DIGEST BY MAURO SICARD</span>
            </header>

            <!-- PRODUCT HUNT -->
            <div class="source-header content-item">
                <img src="../../WEB/assets/producthunt-logo.svg" alt="Product Hunt" class="source-header__logo">
                <span class="source-header__label">From Product Hunt</span>
            </div>

            <div class="source-tags content-item">
                <a href="https://producthunt.com" class="source-tag">Product Hunt</a>
            </div>

            <p class="section-intro content-item">AI meeting tools, open-source TTS, and a macOS audio switcher from the Shopify founder.</p>

            <a href="https://briefmymeeting.com" class="card card--ph content-item">
                <img class="card__favicon" data-size="32" alt="">
                <div class="card__content">
                    <span class="card__title">Brief My Meeting — AI meeting briefs delivered to your inbox</span>
                    <span class="card__desc">AI-powered meeting prep that emails you 4 hours before every call. Gets attendee research from LinkedIn, past email history, previous meetings recap. From creators of Inbox Zero. $9/month. Open source.</span>
                    <div class="card--ph__meta">
                        <span class="card--ph__votes">&#9650; 317</span>
                        <span>·</span>
                        <span>briefmymeeting.com</span>
                    </div>
                </div>
            </a>

            <a href="https://www.resemble.ai/chatterbox-turbo/" class="card card--ph content-item">
                <img class="card__favicon" data-size="32" alt="">
                <div class="card__content">
                    <span class="card__title">Chatterbox Turbo — Fast, expressive, open source TTS</span>
                    <span class="card__desc">350M parameter open-source TTS. MIT licensed, 6x faster than realtime. Voice cloning from 5 seconds of audio, emotion tags ([laugh], [sigh]), built-in watermarking. Runs locally or via API.</span>
                    <div class="card--ph__meta">
                        <span class="card--ph__votes">&#9650; 180</span>
                        <span>·</span>
                        <span>resemble.ai</span>
                    </div>
                </div>
            </a>

            <a href="https://github.com/tobi/AudioPriorityBar" class="card card--ph content-item">
                <img class="card__favicon" data-size="32" alt="">
                <div class="card__content">
                    <span class="card__title">AudioPriorityBar — Priority-based audio switching for macOS</span>
                    <span class="card__desc">macOS menu bar app that auto-switches audio devices based on priority. Set preferred order for speakers/headphones/mics, auto-switches to highest-priority connected device. Open source from Tobi (Shopify founder).</span>
                    <div class="card--ph__meta">
                        <span class="card--ph__votes">&#9650; 179</span>
                        <span>·</span>
                        <span>github.com</span>
                    </div>
                </div>
            </a>

            <a href="https://www.pockethost.shop/" class="card card--ph content-item">
                <img class="card__favicon" data-size="32" alt="">
                <div class="card__content">
                    <span class="card__title">Zone — Liquid glass focus timer for macOS</span>
                    <span class="card__desc">Native macOS focus timer with "liquid glass" design matching macOS Tahoe. Live dock updates show timer progress. Clean, minimal UI for Pomodoro and custom timing.</span>
                    <div class="card--ph__meta">
                        <span class="card--ph__votes">&#9650; 111</span>
                        <span>·</span>
                        <span>pockethost.shop</span>
                    </div>
                </div>
            </a>

            <a href="https://howtheymake.money" class="card card--ph content-item">
                <img class="card__favicon" data-size="32" alt="">
                <div class="card__content">
                    <span class="card__title">HowTheyMakeMoney — Revenue visualization with Sankey diagrams</span>
                    <span class="card__desc">Interactive Sankey diagrams showing how 500+ companies generate revenue. Full income statement flow from revenue to net profit. Compare companies, see breakdowns by segment. Free.</span>
                    <div class="card--ph__meta">
                        <span class="card--ph__votes">&#9650; 21</span>
                        <span>·</span>
                        <span>howtheymake.money</span>
                    </div>
                </div>
            </a>

            <!-- AI & LLMs -->
            <div class="source-header content-item">
                <img src="../../WEB/assets/reddit-logo.svg" alt="Reddit" class="source-header__logo">
                <span class="source-header__label">From Reddit</span>
            </div>

            <div class="source-tags content-item">
                <a href="https://reddit.com/r/singularity" class="source-tag">r/singularity</a>
                <a href="https://reddit.com/r/LocalLLaMA" class="source-tag">r/LocalLLaMA</a>
                <a href="https://reddit.com/r/openai" class="source-tag">r/openai</a>
            </div>

            <p class="section-intro content-item">Claude Code creator goes a full month without opening an IDE. Tencent drops two major open-source releases. SoftBank goes all-in on OpenAI.</p>

            <a href="https://x.com/bcherny/status/2004897269674639461" class="card card--featured content-item">
                <div class="card--featured__header">
                    <img class="card__favicon" data-size="28" alt="">
                    <span class="card--featured__title">Claude Code Creator Ships 100% AI-Written Code for a Month</span>
                </div>
                <div class="card--featured__body">
                    <p>Boris Cherny reports that in the last 30 days, 100% of his contributions to Claude Code were written by Claude Code + Opus 4.5. 259 PRs, 497 commits, 40k lines added, 38k removed — all by AI.</p>
                    <p>First month he didn't open an IDE at all. Sessions ran for hours, sometimes days at a time using stop hooks.</p>
                </div>
                <div class="card--featured__meta">
                    <span>x.com</span> · <span>r/singularity</span>
                </div>
            </a>

            <a href="https://huggingface.co/allura-forge/Llama-3.3-8B-Instruct" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Llama 3.3 8B Extracted from Meta's Hidden API</span>
                    <span class="card__desc">Someone extracted Llama 3.3 8B from Meta's finetuning API where it was hidden. Benchmarks show it outperforms 3.1 8B: IFEval 81.95% vs 78.2%, GPQA Diamond 37% vs 29.3%. An 8B model with 70B-level instruction following.</span>
                </div>
            </a>

            <a href="https://github.com/Tencent-Hunyuan/HY-Motion-1.0" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Tencent Open-Sources Billion-Parameter Text-to-Motion Model</span>
                    <span class="card__desc">First DiT-based motion model at billion scale. Generates skeleton-based 3D animations from text prompts. 200+ motion categories. Full Pre-train to SFT to RL pipeline. Output ready for 3D pipelines.</span>
                </div>
            </a>

            <a href="https://www.cnbc.com/2025/12/30/softbank-openai-investment.html" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">SoftBank Completes $40B OpenAI Investment</span>
                    <span class="card__desc">One of the largest private funding rounds ever. Final $22-22.5B sent last week. SoftBank now owns ~11% of OpenAI. Liquidated entire $5.8B Nvidia stake to fund this. Money supports Stargate infrastructure JV.</span>
                </div>
            </a>

            <p class="section-intro content-item">Quick hits — local models and optimizations.</p>

            <a href="https://codepointer.substack.com/p/llamacpp-accelerate-top-k-sampling" class="card card--link is-compact content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">How llama.cpp Implements 2.9x Faster Top-K Sampling</span>
                    <span class="card__desc">Technical deep-dive: logits cluster in -10 to +10 range, so use 128-bucket histogram instead of sorting. 2.9x faster for k>128.</span>
                </div>
            </a>

            <a href="https://huggingface.co/collections/tencent/hy-mt15" class="card card--link is-compact content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Tencent HY-MT1.5 Translation Models (1.8B & 7B)</span>
                    <span class="card__desc">WMT25 champion. 1.8B runs on-device (1GB memory, 0.18s latency), 7B beats 90th percentile of closed-source. 33+ languages.</span>
                </div>
            </a>

            <a href="https://github.com/Bitterbot-AI/topas_DSLPv1" class="card card--link is-compact content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Tiny 15M Model Hits 24% on ARC-AGI-2 (Previous SOTA: 8%)</span>
                    <span class="card__desc">Novel "Bicameral" architecture: Logic Stream for rules, Canvas Stream for execution. Test-Time Training per puzzle. Open source.</span>
                </div>
            </a>

            <!-- GenAI & Media -->
            <div class="source-header content-item">
                <img src="../../WEB/assets/reddit-logo.svg" alt="Reddit" class="source-header__logo">
                <span class="source-header__label">From Reddit</span>
            </div>

            <div class="source-tags content-item">
                <a href="https://reddit.com/r/StableDiffusion" class="source-tag">r/StableDiffusion</a>
                <a href="https://reddit.com/r/comfyui" class="source-tag">r/comfyui</a>
            </div>

            <p class="section-intro content-item">Image generation — light day, but Chroma model gets some love and Z-Image training tips dropped.</p>

            <a href="https://civitai.com/articles/19951/chroma-guide-v04" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Chroma: The Underappreciated 9B Image Model</span>
                    <span class="card__desc">With Chroma1-Flash + realism LoRA, generates images in ~6 seconds on RTX 5090. V-pred model achieving 1024px+ native generation without refiners. One fine-tune away from top tier. Community guide on Civitai.</span>
                </div>
            </a>

            <a href="https://reddit.com/r/comfyui/comments/1pzvrkr" class="card card--link is-compact content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Optimized Z-Image-Turbo LoRA Training Guide</span>
                    <span class="card__desc">Train at 512px buckets for 2K+ outputs. Full FP32 precision eliminates hallucinations. 15-22 min on RTX 5090, ~1hr on 3090.</span>
                </div>
            </a>

            <!-- Apps & Software -->
            <div class="source-header content-item">
                <img src="../../WEB/assets/reddit-logo.svg" alt="Reddit" class="source-header__logo">
                <span class="source-header__label">From Reddit</span>
            </div>

            <div class="source-tags content-item">
                <a href="https://reddit.com/r/macapps" class="source-tag">r/macapps</a>
                <a href="https://reddit.com/r/selfhosted" class="source-tag">r/selfhosted</a>
                <a href="https://reddit.com/r/SideProject" class="source-tag">r/SideProject</a>
            </div>

            <p class="section-intro content-item">Apps and tools — voice transcription, multi-Mac management, and a clever teleprompter that hides in the notch.</p>

            <a href="https://www.pipitvoice.com/" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Pipit — Free WisprFlow Alternative for macOS</span>
                    <span class="card__desc">Voice transcription + clipboard manager in menu bar. Works offline with local models. Adaptive self-learning dictionary, quick actions. ~25 cents/month with own API key for formatting. Open source planned.</span>
                </div>
            </a>

            <a href="https://tidaldrift.app" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">TidalDrift — Free Apple Remote Desktop Alternative</span>
                    <span class="card__desc">Manage multiple Macs on your network. Bonjour discovery, one-click screen sharing, file sharing, SSH, Wake on LAN, clipboard sync. No cloud — everything stays on your network. Pure Swift. Free.</span>
                </div>
            </a>

            <a href="https://notchie.app" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Notchie — Teleprompter in Your MacBook Notch</span>
                    <span class="card__desc">Sits in the notch area, right under the camera so you maintain eye contact. Voice-activated scrolling syncs to your speaking pace. Doesn't show in screen recordings. Perfect for webinars and video calls.</span>
                </div>
            </a>

            <a href="https://letmewatchnow.com" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">LetMeWatchNow — Watch TikTok/Reels Without the App</span>
                    <span class="card__desc">Paste a TikTok, Instagram, YouTube Shorts or X link, watch directly in browser. Removes tracking params, expands short URLs. No account needed. For people who don't want social media apps on their phone.</span>
                </div>
            </a>

            <a href="https://budgetboard.net" class="card card--link content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Budget Board — Self-Hosted Personal Finance</span>
                    <span class="card__desc">Track monthly budgets, bank accounts, and financial goals. v3.1.1 adds localization and customizable net worth cards. Docker deployment available.</span>
                </div>
            </a>

            <p class="section-intro content-item">Quick hits — smaller tools and utilities.</p>

            <a href="https://github.com/Smaug6739/Alexandrie" class="card card--link is-compact content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">Alexandrie — Self-Hosted Markdown Notes</span>
                    <span class="card__desc">Web-based, works offline, single docker-compose deployment. Uses RustFS instead of MinIO.</span>
                </div>
            </a>

            <a href="https://github.com/Xpycode/CropBatch" class="card card--link is-compact content-item">
                <img class="card__favicon" data-size="18" alt="">
                <div class="card__content">
                    <span class="card__title">CropBatch — Batch Image Cropping for macOS</span>
                    <span class="card__desc">Free, open source macOS app to crop multiple images. Built with Claude Code.</span>
                </div>
            </a>

            <!-- FEEDBACK -->
            <?php if (!empty($submitted)): ?>
                <div class="feedback feedback--success content-item" style="text-align: center; padding: 2rem;">
                    <div style="font-size: 2.5rem; margin-bottom: 0.5rem;">&#10003;</div>
                    <p style="margin: 0; font-weight: 500;">Thanks! Your suggestion has been saved.</p>
                    <p style="margin: 0.5rem 0 0; opacity: 0.7; font-size: 0.875rem;">I'll review it for tomorrow's digest.</p>
                </div>
            <?php else: ?>
                <form method="POST" class="feedback content-item" data-feedback>
                    <button type="button" class="feedback__trigger" data-feedback-trigger>
                        Tell me what to change for tomorrow
                    </button>
                    <div class="feedback__content" data-feedback-content>
                        <textarea name="suggestion" class="feedback__textarea" placeholder="What would you like me to change? More of something, less of another, different topics..."></textarea>
                        <div class="feedback__actions">
                            <button type="button" class="btn btn--secondary" data-feedback-cancel>Cancel</button>
                            <button type="submit" class="btn btn--primary">Send</button>
                        </div>
                    </div>
                </form>
            <?php endif; ?>

        </div>
    </div>

    <script src="../../WEB/js/app.js"></script>
</body>
</html>

``````

### WEB/css/styles.css

``````css
/* ==========================================================================
   AI-DIGEST STYLES
   A scalable, variable-driven stylesheet for the AI Digest newsletter
   ========================================================================== */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    /* -------------------------------------------------------------------------
       COLORS
       ------------------------------------------------------------------------- */

    /* Base */
    --color-white: #ffffff;
    --color-black: #000000;

    /* Gray scale (light) */
    --color-gray-50: #fafafa;
    --color-gray-100: #f8f8f8;
    --color-gray-150: #f5f5f5;
    --color-gray-200: #f0f0f0;
    --color-gray-300: #e5e5e5;
    --color-gray-400: #ccc;
    --color-gray-500: #bbb;
    --color-gray-600: #999;
    --color-gray-700: #888;
    --color-gray-800: #666;
    --color-gray-900: #555;
    --color-gray-950: #333;

    /* Dark palette */
    --color-dark-bg: #0d0d0d;
    --color-dark-card: #1a1a1a;
    --color-dark-elevated: #242424;
    --color-dark-hover: #2a2a2a;
    --color-dark-border: #333;
    --color-dark-border-strong: #444;

    /* Semantic colors */
    --color-text-primary: #1a1a1a;
    --color-text-secondary: var(--color-gray-900);
    --color-text-tertiary: var(--color-gray-700);
    --color-text-muted: var(--color-gray-600);
    --color-text-subtle: var(--color-gray-500);

    --color-bg-page: var(--color-gray-100);
    --color-bg-card: var(--color-white);
    --color-bg-hover: var(--color-gray-50);
    --color-bg-button: var(--color-gray-150);
    --color-bg-button-hover: var(--color-gray-200);

    --color-border: var(--color-gray-200);
    --color-border-strong: var(--color-gray-300);

    /* Brand accents */
    --color-ph-accent: #ff6154;

    /* -------------------------------------------------------------------------
       TYPOGRAPHY
       ------------------------------------------------------------------------- */

    --font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-base: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    --line-height-tight: 1.4;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.7;
    --line-height-loose: 1.8;

    --letter-spacing-tight: -0.02em;
    --letter-spacing-wide: 0.02em;

    /* -------------------------------------------------------------------------
       SPACING
       ------------------------------------------------------------------------- */

    --space-1: 2px;
    --space-2: 4px;
    --space-3: 6px;
    --space-4: 8px;
    --space-5: 10px;
    --space-6: 12px;
    --space-7: 14px;
    --space-8: 16px;
    --space-10: 20px;
    --space-12: 24px;
    --space-14: 28px;
    --space-16: 32px;
    --space-20: 40px;
    --space-24: 48px;

    /* Section spacing */
    --section-gap: var(--space-24);
    --section-gap-sm: var(--space-20);

    /* -------------------------------------------------------------------------
       LAYOUT
       ------------------------------------------------------------------------- */

    --container-max-width: 600px;
    --card-padding: 80px;
    --card-padding-inner: var(--space-14);

    /* -------------------------------------------------------------------------
       COMPONENTS
       ------------------------------------------------------------------------- */

    /* Favicon */
    --favicon-size: 18px;
    --favicon-size-lg: 28px;

    /* Source logo */
    --source-logo-size: 24px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-3xl: 16px;
    --radius-full: 100px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06);

    /* -------------------------------------------------------------------------
       TRANSITIONS & ANIMATIONS
       ------------------------------------------------------------------------- */

    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.4s;
    --duration-slower: 0.5s;

    --ease-default: ease;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Animation system */
    --animation-distance: 16px;
    --animation-blur: 8px;
    --animation-base-delay: 0.1s;
    --animation-stagger: 0.06s;
}


/* ==========================================================================
   DARK THEME
   Remaps semantic tokens to dark palette values
   ========================================================================== */

[data-theme="dark"] {
    /* Text colors - inverted for dark backgrounds */
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #e0e0e0;
    --color-text-tertiary: #a0a0a0;
    --color-text-muted: #888;
    --color-text-subtle: #666;

    /* Background colors */
    --color-bg-page: var(--color-dark-bg);
    --color-bg-card: var(--color-dark-card);
    --color-bg-hover: var(--color-dark-hover);
    --color-bg-button: var(--color-dark-elevated);
    --color-bg-button-hover: var(--color-dark-hover);

    /* Border colors */
    --color-border: var(--color-dark-border);
    --color-border-strong: var(--color-dark-border-strong);

    /* Shadows - more subtle in dark mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Dark mode button overrides */
[data-theme="dark"] .btn--primary {
    background: var(--color-white);
    color: var(--color-dark-card);
}

[data-theme="dark"] .btn--primary:hover {
    background: var(--color-gray-200);
}

/* Dark mode favicon background */
[data-theme="dark"] .card__favicon {
    background: var(--color-dark-elevated);
}


/* ==========================================================================
   BASE STYLES
   ========================================================================== */

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
    background: var(--color-bg-page);
    padding: 60px var(--space-6);
    min-height: 100vh;
    transition: background-color var(--duration-normal) var(--ease-smooth),
                color var(--duration-normal) var(--ease-smooth);
}

/* Smooth theme transition for cards and components */
.main-card,
.card,
.source-tag,
.feedback__trigger,
.feedback__content,
.feedback__textarea,
.btn {
    transition: background-color var(--duration-normal) var(--ease-smooth),
                border-color var(--duration-normal) var(--ease-smooth),
                color var(--duration-normal) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-smooth);
}


/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}


/* ==========================================================================
   MAIN CARD
   ========================================================================== */

.main-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-3xl);
    padding: var(--card-padding);
    box-shadow: var(--shadow-sm);
}


/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-16);
    padding-bottom: var(--space-10);
    border-bottom: 1px solid var(--color-border);
}

.page-header__date {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.page-header__credits {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-subtle);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}


/* ==========================================================================
   SOURCE SECTION (Reddit, Product Hunt headers)
   ========================================================================== */

.source-header {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-top: var(--section-gap);
    margin-bottom: var(--space-5);
}

/* First source header after page header */
.page-header + .source-header {
    margin-top: 0;
}

.source-header__logo {
    width: var(--source-logo-size);
    height: var(--source-logo-size);
    border-radius: var(--radius-md);
}

.source-header__label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

/* Source tags (subreddits) */
.source-tags {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.source-tag {
    display: inline-block;
    padding: var(--space-2) var(--space-5);
    background: var(--color-bg-card);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-default);
}

.source-tag:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}


/* ==========================================================================
   SECTION INTRO TEXT
   ========================================================================== */

.section-intro {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-tertiary);
    margin-top: var(--section-gap-sm);
    margin-bottom: var(--space-10);
}

/* After source tags, reduce top margin */
.source-tags + .section-intro {
    margin-top: var(--space-8);
}

.section-intro--placeholder {
    color: var(--color-text-subtle);
    font-style: italic;
}


/* ==========================================================================
   CARDS
   ========================================================================== */

/* Shared card base styles */
.card {
    display: block;
    background: var(--color-bg-card);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-2xl);
    text-decoration: none;
    color: inherit;
    transition:
        background var(--duration-fast) var(--ease-default),
        border-color var(--duration-fast) var(--ease-default),
        box-shadow var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-smooth);
}

.card:hover {
    border-color: var(--color-border-strong);
}

/* -------------------------------------------------------------------------
   Featured Card (larger, prominent)
   ------------------------------------------------------------------------- */

.card--featured {
    padding: var(--card-padding-inner);
    margin-left: calc(var(--card-padding-inner) * -1);
    margin-right: calc(var(--card-padding-inner) * -1);
    margin-bottom: var(--space-5);
}

.card--featured:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card--featured__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}

.card--featured__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.card--featured__body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-loose);
    color: var(--color-text-secondary);
}

.card--featured__body p {
    margin-bottom: var(--space-5);
}

.card--featured__body p:last-child {
    margin-bottom: 0;
}

.card--featured__meta {
    margin-top: var(--space-8);
    padding-top: var(--space-7);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
}

/* Featured card favicon override */
.card--featured .card__favicon {
    width: var(--favicon-size-lg);
    height: var(--favicon-size-lg);
    border-radius: var(--radius-3xl);
    top: 0;
}

/* -------------------------------------------------------------------------
   Link Card (list item style)
   ------------------------------------------------------------------------- */

.card--link {
    display: flex;
    align-items: flex-start;
    gap: var(--space-7);
    padding: var(--space-8) var(--card-padding-inner);
    margin-left: calc(var(--card-padding-inner) * -1);
    margin-right: calc(var(--card-padding-inner) * -1);
    margin-bottom: var(--space-5);
}

.card--link:last-child {
    margin-bottom: 0;
}

.card--link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Compact variant */
.card--link.is-compact {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

.card--link.is-compact .card__desc {
    margin-top: var(--space-1);
}

/* -------------------------------------------------------------------------
   Card Content Elements
   ------------------------------------------------------------------------- */

.card__favicon {
    flex-shrink: 0;
    width: var(--favicon-size);
    height: var(--favicon-size);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-white);
    position: relative;
    top: 2px;
}

.card__content {
    flex: 1;
}

.card__title {
    display: block;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

.card__desc {
    display: block;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-tertiary);
    margin-top: var(--space-2);
}

/* -------------------------------------------------------------------------
   Product Hunt Card
   ------------------------------------------------------------------------- */

.card--ph {
    display: flex;
    align-items: flex-start;
    gap: var(--space-6);
    padding: var(--space-6) var(--card-padding-inner);
    margin-left: calc(var(--card-padding-inner) * -1);
    margin-right: calc(var(--card-padding-inner) * -1);
    margin-bottom: var(--space-4);
}

.card--ph:last-child {
    margin-bottom: 0;
}

.card--ph:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card--ph .card__favicon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-3xl);
    top: 2px;
}

.card--ph .card__title {
    margin-bottom: var(--space-2);
}

.card--ph .card__desc {
    font-size: var(--font-size-sm);
    margin-top: 0;
    margin-bottom: var(--space-3);
}

.card--ph__meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--font-size-xs);
    color: var(--color-text-subtle);
}

.card--ph__votes {
    color: var(--color-ph-accent);
    font-weight: var(--font-weight-medium);
}


/* ==========================================================================
   FEEDBACK BOX
   ========================================================================== */

.feedback {
    margin-top: var(--section-gap);
    margin-left: calc(var(--card-padding-inner) * -1);
    margin-right: calc(var(--card-padding-inner) * -1);
}

.feedback__trigger {
    display: block;
    width: 100%;
    padding: var(--space-7) var(--card-padding-inner);
    background: var(--color-bg-button);
    border: none;
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: var(--font-size-base);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-tertiary);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.feedback__trigger:hover {
    background: var(--color-bg-button-hover);
    color: var(--color-text-muted);
}

.feedback__trigger.is-expanded {
    background: var(--color-bg-hover);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.feedback__content {
    max-height: 0;
    overflow: hidden;
    background: var(--color-bg-hover);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    opacity: 0;
    transition:
        max-height var(--duration-slow) var(--ease-smooth),
        padding var(--duration-slow) var(--ease-smooth),
        opacity var(--duration-normal) var(--ease-default);
}

.feedback__content.is-open {
    max-height: 300px;
    padding: 0 var(--space-10) var(--space-10);
    opacity: 1;
}

.feedback__textarea {
    width: 100%;
    min-height: 90px;
    padding: var(--space-6) var(--space-7);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    font-family: inherit;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
    resize: vertical;
    transition: border-color var(--duration-fast) var(--ease-default);
}

.feedback__textarea:focus {
    outline: none;
    border-color: var(--color-gray-400);
}

.feedback__textarea::placeholder {
    color: var(--color-text-subtle);
}

.feedback__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-4);
    margin-top: var(--space-6);
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity var(--duration-normal) var(--ease-default) 0.1s,
        transform var(--duration-normal) var(--ease-default) 0.1s;
}

.feedback__content.is-open .feedback__actions {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    padding: var(--space-4) var(--space-7);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-md);
    letter-spacing: var(--letter-spacing-tight);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.btn--secondary {
    background: transparent;
    color: var(--color-text-tertiary);
}

.btn--secondary:hover {
    background: var(--color-bg-button-hover);
    color: var(--color-text-muted);
}

.btn--primary {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
    background: var(--color-text-primary);
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
}

.btn--primary:hover {
    background: var(--color-gray-950);
}


/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(var(--animation-distance));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(var(--animation-blur));
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Content item animation system */
.content-item {
    --animation-index: 0;
    opacity: 0;
    animation: fadeInUp var(--duration-slow) var(--ease-smooth) both;
    animation-delay: calc(var(--animation-base-delay) + var(--animation-index) * var(--animation-stagger));
}

.content-item--featured {
    animation-name: blurIn;
    animation-duration: var(--duration-slower);
}

.content-item--fast {
    animation-duration: var(--duration-normal);
}

.content-item--no-delay {
    animation-delay: 0s;
}

/* Cards with hover transforms need opacity-only animation to avoid transform conflict */
.card--link.content-item,
.card--featured.content-item,
.card--ph.content-item {
    animation-name: fadeIn;
}


/* ==========================================================================
   RESPONSIVE STYLES
   Mobile-first adjustments for smaller screens
   ========================================================================== */

/* Tablet and below */
@media (max-width: 768px) {
    :root {
        --card-padding: 40px;
        --section-gap: var(--space-20);
    }

    body {
        padding: 32px var(--space-4);
    }

    .main-card {
        border-radius: var(--radius-2xl);
    }

    .page-header {
        flex-direction: column;
        gap: var(--space-2);
        margin-bottom: var(--space-12);
    }

    .page-header__credits {
        font-size: var(--font-size-xs);
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    :root {
        --card-padding: 20px;
        --card-padding-inner: var(--space-10);
        --section-gap: var(--space-16);
        --section-gap-sm: var(--space-14);
    }

    body {
        padding: 16px var(--space-3);
    }

    .main-card {
        border-radius: var(--radius-xl);
        padding: var(--card-padding);
    }

    /* Page header */
    .page-header {
        margin-bottom: var(--space-10);
        padding-bottom: var(--space-6);
    }

    .page-header__date {
        font-size: var(--font-size-sm);
    }

    /* Source header */
    .source-header {
        margin-top: var(--space-16);
        gap: var(--space-4);
    }

    .source-header__logo {
        width: 20px;
        height: 20px;
    }

    .source-header__label {
        font-size: var(--font-size-base);
    }

    /* Source tags */
    .source-tags {
        gap: var(--space-2);
    }

    .source-tag {
        padding: var(--space-1) var(--space-4);
        font-size: var(--font-size-xs);
    }

    /* Section intro */
    .section-intro {
        font-size: var(--font-size-sm);
        margin-top: var(--space-12);
        margin-bottom: var(--space-8);
    }

    .source-tags + .section-intro {
        margin-top: var(--space-6);
    }

    /* Cards - reduce negative margins */
    .card--featured,
    .card--link,
    .card--ph {
        margin-left: calc(var(--card-padding-inner) * -0.5);
        margin-right: calc(var(--card-padding-inner) * -0.5);
    }

    /* Featured card */
    .card--featured {
        padding: var(--space-8);
    }

    .card--featured__header {
        gap: var(--space-4);
        margin-bottom: var(--space-5);
    }

    .card--featured__title {
        font-size: var(--font-size-lg);
    }

    .card--featured__body {
        font-size: var(--font-size-sm);
    }

    .card--featured__meta {
        margin-top: var(--space-6);
        padding-top: var(--space-5);
        font-size: var(--font-size-xs);
    }

    .card--featured .card__favicon {
        width: 24px;
        height: 24px;
    }

    /* Link card */
    .card--link {
        gap: var(--space-5);
        padding: var(--space-6) var(--space-8);
        margin-bottom: var(--space-4);
    }

    .card--link.is-compact {
        padding-top: var(--space-5);
        padding-bottom: var(--space-5);
    }

    .card__title {
        font-size: var(--font-size-sm);
    }

    .card__desc {
        font-size: var(--font-size-xs);
    }

    .card__favicon {
        width: 16px;
        height: 16px;
    }

    /* Product Hunt card */
    .card--ph {
        gap: var(--space-5);
        padding: var(--space-5) var(--space-8);
        margin-bottom: var(--space-3);
    }

    .card--ph .card__favicon {
        width: 28px;
        height: 28px;
    }

    .card--ph .card__title {
        font-size: var(--font-size-sm);
    }

    .card--ph .card__desc {
        font-size: var(--font-size-xs);
    }

    .card--ph__meta {
        gap: var(--space-3);
        font-size: 10px;
    }

    /* Feedback */
    .feedback {
        margin-left: calc(var(--card-padding-inner) * -0.5);
        margin-right: calc(var(--card-padding-inner) * -0.5);
    }

    .feedback__trigger {
        padding: var(--space-5) var(--space-8);
        font-size: var(--font-size-sm);
    }

    .feedback__content.is-open {
        padding: 0 var(--space-6) var(--space-6);
    }

    .feedback__textarea {
        min-height: 80px;
        padding: var(--space-5) var(--space-6);
        font-size: var(--font-size-sm);
    }

    .feedback__actions {
        gap: var(--space-3);
    }

    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--font-size-sm);
    }

    .btn--primary {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    :root {
        --card-padding: 16px;
        --card-padding-inner: var(--space-8);
    }

    body {
        padding: 12px var(--space-2);
    }

    .main-card {
        border-radius: var(--radius-lg);
    }

    .card--featured,
    .card--link,
    .card--ph {
        margin-left: calc(var(--card-padding-inner) * -0.25);
        margin-right: calc(var(--card-padding-inner) * -0.25);
    }
}

``````

### WEB/js/app.js

``````javascript
/**
 * AI Digest - Main Application
 * Handles theme detection, animations, favicon loading, external links, and feedback
 */

(function() {
    'use strict';

    // ==========================================================================
    // ANIMATION SYSTEM
    // Automatically assigns staggered animation delays based on DOM order
    // ==========================================================================

    function initAnimations() {
        const items = document.querySelectorAll('.content-item');
        const sections = document.querySelectorAll('[data-animation-section]');

        if (sections.length > 0) {
            // Section-based: reset index for each section
            sections.forEach(section => {
                const sectionItems = section.querySelectorAll('.content-item');
                sectionItems.forEach((item, index) => {
                    item.style.setProperty('--animation-index', index);
                });
            });

            // Handle items outside sections
            let globalIndex = 0;
            items.forEach(item => {
                if (!item.closest('[data-animation-section]')) {
                    item.style.setProperty('--animation-index', globalIndex);
                    globalIndex++;
                }
            });
        } else {
            // Global: sequential index across entire page
            items.forEach((item, index) => {
                item.style.setProperty('--animation-index', index);
            });
        }
    }

    // ==========================================================================
    // FAVICON LOADING
    // Tries domain's favicon.ico first, then DuckDuckGo as fallback
    // ==========================================================================

    function loadSingleFavicon(img, domain, displaySize) {
        const directUrl = `https://${domain}/favicon.ico`;
        const ddgUrl = `https://icons.duckduckgo.com/ip3/${domain}.ico`;

        img.width = displaySize;
        img.height = displaySize;

        // Chain: try direct → DDG
        img.onerror = () => {
            img.onerror = null;
            img.src = ddgUrl;
        };

        img.src = directUrl;
    }

    function loadFavicons() {
        // Auto-source favicons from parent link href for card elements
        const cards = document.querySelectorAll('.card--link[href], .card--featured[href], .card--ph[href]');

        cards.forEach(card => {
            const img = card.querySelector('.card__favicon');
            if (!img || !card.href) return;

            try {
                const domain = new URL(card.href).hostname;
                const displaySize = img.dataset.size || 18;
                loadSingleFavicon(img, domain, displaySize);
            } catch (e) {
                // Invalid URL, use fallback
                img.src = FAVICON_FALLBACK;
            }
        });

        // Handle explicit data-favicon attributes (if any)
        document.querySelectorAll('[data-favicon]').forEach(img => {
            try {
                const domain = new URL(img.dataset.favicon).hostname;
                const displaySize = img.dataset.size || 16;
                loadSingleFavicon(img, domain, displaySize);
            } catch (e) {
                // Invalid URL, use fallback
                img.src = FAVICON_FALLBACK;
            }
        });
    }

    // ==========================================================================
    // EXTERNAL LINKS
    // Opens all external links in new tab with security attributes
    // ==========================================================================

    function initExternalLinks() {
        document.querySelectorAll('a[href^="http"]').forEach(link => {
            link.setAttribute('target', '_blank');
            link.setAttribute('rel', 'noopener noreferrer');
        });
    }

    // ==========================================================================
    // FEEDBACK BOX
    // Expandable feedback form with event delegation
    // ==========================================================================

    function initFeedback() {
        const feedbackContainer = document.querySelector('[data-feedback]');
        if (!feedbackContainer) return;

        const trigger = feedbackContainer.querySelector('[data-feedback-trigger]');
        const content = feedbackContainer.querySelector('[data-feedback-content]');
        const textarea = feedbackContainer.querySelector('.feedback__textarea');
        const cancelBtn = feedbackContainer.querySelector('[data-feedback-cancel]');
        const submitBtn = feedbackContainer.querySelector('[data-feedback-submit]');

        if (!trigger || !content) return;

        function openFeedback() {
            trigger.classList.add('is-expanded');
            content.classList.add('is-open');
            setTimeout(() => textarea?.focus(), 300);
        }

        function closeFeedback() {
            trigger.classList.remove('is-expanded');
            content.classList.remove('is-open');
            if (textarea) textarea.value = '';
        }

        function submitFeedback() {
            const feedback = textarea?.value.trim();

            if (feedback) {
                // TODO: Replace with actual API call
                console.log('Feedback submitted:', feedback);
                alert("Thanks! I'll adjust for tomorrow.");
                closeFeedback();
            } else {
                textarea?.focus();
            }
        }

        // Event listeners
        trigger.addEventListener('click', () => {
            if (content.classList.contains('is-open')) {
                closeFeedback();
            } else {
                openFeedback();
            }
        });

        cancelBtn?.addEventListener('click', closeFeedback);
        submitBtn?.addEventListener('click', submitFeedback);

        // Submit on Cmd/Ctrl + Enter
        textarea?.addEventListener('keydown', (e) => {
            if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
                e.preventDefault();
                submitFeedback();
            }
        });
    }

    // ==========================================================================
    // THEME DETECTION
    // Auto-detects system preference and listens for changes
    // ==========================================================================

    function initTheme() {
        const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');

        function applyTheme(isDark) {
            document.documentElement.dataset.theme = isDark ? 'dark' : 'light';
        }

        // Apply initial theme
        applyTheme(mediaQuery.matches);

        // Listen for system theme changes
        mediaQuery.addEventListener('change', (e) => applyTheme(e.matches));
    }

    // ==========================================================================
    // INITIALIZATION
    // ==========================================================================

    function init() {
        initTheme();
        initAnimations();
        loadFavicons();
        initExternalLinks();
        initFeedback();
    }

    // Run on DOM ready
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', init);
    } else {
        init();
    }

})();

``````

