Capstone Project: Responsive Hero & Glassmorphism Card
Welcome to the grand finale of the CSS Basics Masterclass! You have mastered the essential pillars of modern web styling:
- CSS ruleset anatomy, selectors, and inheritance
- The Box Model, padding, borders, and
box-sizing: border-box - Modern 1D Flexbox and 2D CSS Grid layouts
- Coordinate positioning (
relative,absolute,fixed,sticky) andz-index - The Cascade, specificity scoring, and responsive
@mediaqueries - CSS Variables, 2D transforms, smooth transitions, and
@keyframes
In this capstone project, you will combine all of these disciplines to engineer a sleek, modern SaaS Landing Page Hero Section featuring a translucent Glassmorphism Product Card.
1. Project Blueprint & Architectural Wireframe
Our hero section features a responsive split layout:
- Left Column: Impactful headline, subtitle value proposition, and call-to-action buttons.
- Right Column: Floating glassmorphic card with backdrop blur, glowing gradients, badges, and smooth hover elevation.
┌────────────────────────────────────────────────────────────────────────┐
│ .hero-section (CSS Grid: 2 Columns on desktop, 1 on mobile) │
│ │
│ LEFT COLUMN (.hero-text) RIGHT COLUMN (.hero-visual) │
│ ┌──────────────────────────────┐ ┌──────────────────────────────┐ │
│ │ <span class="badge"> │ │ .ambient-glow (blur circle) │ │
│ │ New: CSS Basics 2026 │ │ ┌────────────────────────┐ │ │
│ │ </span> │ │ │ .glass-card │ │ │
│ │ <h1>Build the Future...</h1> │ │ │ backdrop-filter: blur │ │ │
│ │ <p>Interactive coding... </p>│ │ │ transform: translateY │ │ │
│ │ <div class="cta-group"> │ │ │ Stats, metrics, avatar │ │ │
│ │ <button class="btn-primary"│ │ └────────────────────────┘ │ │
│ │ <button class="btn-ghost"> │ └──────────────────────────────┘ │
│ └──────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────┘
2. Step 1: Design Tokens & CSS Variables
We start by establishing our design system in the :root pseudo-class. Defining CSS variables guarantees consistent colors and effortless theme updates:
:root { /* Color Palette */ --bg-dark: #0b0f19; --text-primary: #f8fafc; --text-muted: #94a3b8; --primary-accent: #6366f1; --primary-glow: rgba(99, 102, 241, 0.35); /* Glassmorphism Formula */ --glass-surface: rgba(255, 255, 255, 0.05); --glass-border: rgba(255, 255, 255, 0.12); --glass-blur: blur(16px); /* Sizing & Radius */ --radius-lg: 20px; --radius-sm: 8px;}3. Step 2: Modern CSS Grid Hero Architecture
We structure our parent .hero container with modern CSS Grid. On desktops, we use two equal columns (1fr 1fr), and on mobile viewports, we collapse to a single column:
/* Base Reset */* { box-sizing: border-box; margin: 0; padding: 0;}body { font-family: 'Inter', system-ui, sans-serif; background-color: var(--bg-dark); color: var(--text-primary); min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow-x: hidden;}/* Two-Column Grid */.hero { max-width: 1100px; width: 90%; margin: 0 auto; padding: 60px 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center;}/* Mobile-First Responsive Breakpoint */@media (max-width: 868px) { .hero { grid-template-columns: 1fr; text-align: center; padding: 40px 0; }}4. Step 3: The Secret Formula for Glassmorphism
Glassmorphism creates the illusion of frosted glass hovering over a vibrant background. Achieving this requires three fundamental properties:
- Semi-Transparent Background:
background: rgba(255, 255, 255, 0.06); - Backdrop Filter Blur:
backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);(blurs whatever is visually behind the card). - Subtle Light Rim Border:
border: 1px solid rgba(255, 255, 255, 0.15);(simulates the glass edge catching ambient light).
.glass-card { position: relative; background: var(--glass-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 32px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); /* Smooth transform transition */ transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;}5. Step 4: Ambient Glow & Depth Layers
To make frosted glass pop, place an ambient glowing blurred orb behind it using absolute positioning:
.card-wrapper { position: relative;}/* Glowing ambient color orb */.ambient-glow { position: absolute; top: -20px; right: -20px; width: 200px; height: 200px; background: radial-gradient(circle, #6366f1 0%, rgba(236, 72, 153, 0) 70%); filter: blur(50px); z-index: 0; pointer-events: none;}6. Step 5: Hover States & Interactive Physics
When the user hovers over the glass card or buttons, smooth 3D translations and glow expansions provide tactile feedback:
.glass-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 30px var(--primary-glow); border-color: rgba(255, 255, 255, 0.3);}.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; border: none; padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; box-shadow: 0 4px 15px var(--primary-glow); transition: transform 0.2s ease, box-shadow 0.2s ease;}.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);}7. Live Interactive Hero & Glassmorphism Sandbox
Test, tweak, and customize the entire hero section below! Modify gradient colors, blur radius, or padding and view instant live results across Desktop, Tablet, and Mobile viewports:
Complete Glassmorphism Hero Section Sandbox
Live SandboxInspect the backdrop blur, ambient glow gradients, and interactive hover transitions live.
8. Flashcards & Core Concepts
What three CSS properties are required to achieve the glassmorphism aesthetic?
What is the role of -webkit-backdrop-filter?
Why is pointer-events: none helpful on background ambient glow orbs?