Design Tokens
Start every project by defining design tokens. Every value that appears more than once goes in a custom property.
CSS – Design tokens
:root {
/* Colors */
--color-primary: #1572B6;
--color-primary-dark: #0f5fa0;
--color-accent: #FFD43B;
--color-text: #1a1a1a;
--color-text-muted: #666;
--color-bg: #ffffff;
--color-bg-alt: #f8f9fa;
--color-border: #e0e0e0;
/* Typography */
--font: system-ui, -apple-system, Segoe UI, sans-serif;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--h1: clamp(2rem, 5vw + 0.5rem, 3.5rem);
--h2: clamp(1.5rem, 3vw + 0.3rem, 2.25rem);
--leading: 1.7;
/* Spacing */
--space-sm: 0.5rem;
--space-md: 1rem;
--space-lg: 2rem;
--space-xl: 4rem;
--space-2xl: 6rem;
/* Other */
--radius: 10px;
--radius-lg: 16px;
--shadow-card: 0 4px 16px rgba(0,0,0,.08);
--shadow-lg: 0 12px 40px rgba(0,0,0,.15);
--transition: 0.2s cubic-bezier(.4,0,.2,1);
--max-width: 1100px;
}
/* Global reset */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--font); color: var(--color-text); line-height: var(--leading); background: var(--color-bg); margin: 0; }
img { display: block; max-width: 100%; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg); }
Hero Section
CSS – Hero section
.hero {
background: linear-gradient(135deg, #0a1628 0%, #1572B6 60%, #1a3a5c 100%);
color: #fff;
padding: var(--space-2xl) var(--space-lg);
text-align: center;
position: relative;
overflow: hidden;
}
/* Decorative background circles */
.hero::before,
.hero::after {
content: "";
position: absolute;
border-radius: 50%;
opacity: .12;
}
.hero::before { width: 600px; height: 600px; background: var(--color-accent); top: -200px; right: -200px; }
.hero::after { width: 400px; height: 400px; background: #fff; bottom: -150px; left: -100px; }
.hero__badge {
display: inline-flex;
align-items: center;
gap: .5rem;
background: rgba(255,255,255,.12);
border: 1px solid rgba(255,255,255,.25);
border-radius: 9999px;
padding: .35rem 1rem;
font-size: var(--text-sm);
font-weight: 600;
margin-bottom: var(--space-lg);
}
.hero__title {
font-size: var(--h1);
font-weight: 800;
line-height: 1.15;
margin: 0 auto var(--space-md);
max-width: 760px;
}
.hero__title .accent { color: var(--color-accent); }
.hero__subtitle {
font-size: var(--text-lg);
color: rgba(255,255,255,.82);
max-width: 560px;
margin: 0 auto var(--space-lg);
}
.hero__actions {
display: flex;
gap: var(--space-md);
justify-content: center;
flex-wrap: wrap;
}
.hero__stats {
display: flex;
gap: var(--space-xl);
justify-content: center;
margin-top: var(--space-xl);
flex-wrap: wrap;
}
.hero__stat-num { font-size: 2rem; font-weight: 800; color: var(--color-accent); display: block; }
.hero__stat-label { font-size: var(--text-sm); color: rgba(255,255,255,.7); }
Ad – 336×280
Feature Grid Section
CSS – Features section
.features {
padding: var(--space-2xl) var(--space-lg);
background: var(--color-bg-alt);
}
.section-header {
text-align: center;
margin-bottom: var(--space-xl);
}
.section-header h2 { font-size: var(--h2); margin-bottom: var(--space-sm); }
.section-header p { color: var(--color-text-muted); max-width: 560px; margin: 0 auto; }
.features__grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 1.5rem;
}
.feature-card {
background: #fff;
border-radius: var(--radius);
padding: 1.75rem;
border: 1px solid var(--color-border);
transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-card);
}
.feature-card__icon {
width: 52px;
height: 52px;
background: rgba(21,114,182,.1);
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
margin-bottom: var(--space-md);
}
.feature-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.feature-card p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }
Pricing Section
CSS – Pricing section
.pricing {
padding: var(--space-2xl) var(--space-lg);
}
.pricing__grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
max-width: 900px;
margin: 0 auto;
}
.pricing-card {
border: 2px solid var(--color-border);
border-radius: var(--radius-lg);
padding: 2rem;
transition: transform var(--transition);
}
/* Popular card — highlighted */
.pricing-card--popular {
border-color: var(--color-primary);
position: relative;
}
.pricing-card--popular::before {
content: "Most Popular";
position: absolute;
top: -14px;
left: 50%;
transform: translateX(-50%);
background: var(--color-primary);
color: #fff;
font-size: .72rem;
font-weight: 700;
padding: .25rem .9rem;
border-radius: 9999px;
white-space: nowrap;
text-transform: uppercase;
letter-spacing: .06em;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card__tier { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-primary); margin-bottom: .5rem; }
.pricing-card__price { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.pricing-card__price sub { font-size: 1rem; font-weight: 400; vertical-align: top; margin-top: .5rem; color: var(--color-text-muted); }
.pricing-card__period { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: 1.25rem; }
.pricing-card__list { list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .875rem; }
.pricing-card__list li { padding: .4rem 0; border-bottom: 1px solid var(--color-border); display: flex; gap: .5rem; }
.pricing-card__list li::before { content: '✓'; color: #2e7d32; font-weight: 700; flex-shrink: 0; }
Testimonials
CSS – Testimonials
.testimonials { padding: var(--space-2xl) var(--space-lg); background: var(--color-bg-alt); }
.testimonials__grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
}
.testimonial-card {
background: #fff;
border-radius: var(--radius);
padding: 1.5rem;
border: 1px solid var(--color-border);
position: relative;
}
.testimonial-card::before {
content: "\201C"; /* left double quote */
position: absolute;
top: .75rem;
left: 1rem;
font-size: 3.5rem;
line-height: 1;
color: var(--color-primary);
opacity: .2;
font-family: Georgia, serif;
}
.testimonial-card__text { font-size: .9rem; line-height: 1.7; margin: 0 0 1.25rem; padding-top: 1.25rem; }
.testimonial-card__author { display: flex; align-items: center; gap: .75rem; }
.testimonial-card__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--color-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.testimonial-card__name { font-weight: 700; font-size: .9rem; }
.testimonial-card__role { font-size: .78rem; color: var(--color-text-muted); }
CTA Banner
CSS – CTA banner
.cta-banner {
background: linear-gradient(135deg, var(--color-primary), #0a1628);
color: #fff;
padding: var(--space-2xl) var(--space-lg);
text-align: center;
}
.cta-banner h2 { font-size: var(--h2); margin-bottom: var(--space-md); }
.cta-banner p { color: rgba(255,255,255,.8); max-width: 520px; margin: 0 auto var(--space-lg); }
.cta-banner__actions { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; }
/* Primary CTA button */
.btn-cta-primary {
background: var(--color-accent);
color: #1a1a2e;
padding: .85rem 2.25rem;
border-radius: 6px;
font-weight: 800;
font-size: 1.05rem;
text-decoration: none;
transition: transform var(--transition), box-shadow var(--transition);
}
.btn-cta-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(255,212,59,.4); }
/* Secondary CTA */
.btn-cta-secondary {
background: transparent;
color: #fff;
border: 2px solid rgba(255,255,255,.4);
padding: .85rem 2.25rem;
border-radius: 6px;
font-weight: 600;
text-decoration: none;
transition: border-color var(--transition);
}
.btn-cta-secondary:hover { border-color: rgba(255,255,255,.8); }
Footer
CSS – Footer
.footer {
background: #0a1628;
color: rgba(255,255,255,.7);
padding: var(--space-xl) var(--space-lg) var(--space-lg);
}
.footer__grid {
display: grid;
grid-template-columns: 2fr repeat(3, 1fr);
gap: 3rem;
margin-bottom: var(--space-xl);
}
.footer__brand { max-width: 280px; }
.footer__brand p { font-size: .875rem; line-height: 1.7; margin-top: .75rem; }
.footer__col h4 { color: #fff; font-size: .9rem; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.footer__links { list-style: none; padding: 0; margin: 0; }
.footer__links li { margin-bottom: .4rem; }
.footer__links a { color: rgba(255,255,255,.6); text-decoration: none; font-size: .875rem; transition: color .15s; }
.footer__links a:hover { color: #fff; }
.footer__bottom {
border-top: 1px solid rgba(255,255,255,.1);
padding-top: var(--space-md);
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: .5rem;
font-size: .82rem;
}
@media (max-width: 768px) {
.footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
.footer__grid { grid-template-columns: 1fr; }
}
📋 What This Project Covers
- Design tokens — all values in
:rootcustom properties for global consistency. - Fluid typography —
clamp()for headings that scale with viewport, no breakpoints needed. - Hero section — gradient background, decorative
::before/::aftershapes, centered flexbox layout. - Feature grid —
auto-fill minmax()for a naturally responsive card grid without media queries. - Pricing cards — highlighted popular card using
::beforepseudo-element ribbon. - Testimonials — quote pseudo-element, avatar, grid layout.
- CTA banner — gradient background, contrast buttons with accent color.
- Footer — CSS Grid multi-column layout that collapses gracefully on mobile.