1941 lines
44 KiB
CSS

/* ============================================================
PettyUI Showcase — Premium Dark SaaS Theme
============================================================ */
/* --- Design Tokens --- */
:root {
/* ── Gray palette (Slate) ── */
--gray-1: #f4f6f9;
--gray-2: #f1f5f9;
--gray-3: #e2e8f0;
--gray-4: #cbd5e1;
--gray-5: #94a3b8;
--gray-6: #64748b;
--gray-7: #475569;
--gray-8: #334155;
--gray-9: #1e293b;
--gray-10: #0f172a;
/* ── Accent palette (Aperture Blue) ── */
--accent-1: #edf9fe;
--accent-2: #d4f1fd;
--accent-3: #a8e3fb;
--accent-4: #6dcef5;
--accent-5: #36c0f1;
--accent-6: #1fa8d8;
--accent-7: #1890ba;
--accent-8: #14769a;
--accent-contrast: #ffffff;
/* ── Semantic colors ── */
--color-bg: var(--gray-1);
--color-surface: #ffffff;
--color-surface-raised: var(--gray-2);
--color-surface-sunken: var(--gray-3);
--color-border: var(--gray-3);
--color-border-strong: var(--gray-4);
--color-text: var(--gray-10);
--color-text-secondary: var(--gray-6);
--color-text-tertiary: var(--gray-5);
--color-accent: var(--accent-5);
--color-accent-hover: var(--accent-6);
--color-accent-subtle: var(--accent-1);
--color-accent-muted: rgba(54, 192, 241, 0.08);
--color-danger: #dc2626;
--color-danger-subtle: #fef2f2;
--color-warning: #d97706;
--color-warning-subtle: #fffbeb;
--color-success: #16a34a;
--color-success-subtle: #f0fdf4;
/* ── Typography ── */
--font-sans: "Source Sans 3", system-ui, sans-serif;
--font-mono: "Source Code Pro", ui-monospace, monospace;
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 1.875rem;
--text-4xl: 2.25rem;
--text-hero: clamp(3rem, 8vw, 5rem);
--weight-normal: 400;
--weight-medium: 500;
--weight-semibold: 600;
--weight-bold: 700;
--leading-tight: 1.15;
--leading-normal: 1.5;
--leading-relaxed: 1.7;
/* ── Spacing (4px base) ── */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.25rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-10: 2.5rem;
--space-12: 3rem;
--space-16: 4rem;
--space-20: 5rem;
--space-24: 6rem;
/* ── Radius (3 values: small, medium, pill) ── */
--radius-xs: 4px;
--radius-sm: 8px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-xl: 12px;
--radius-pill: 22px;
/* ── Elevation ── */
--elevation-0: none;
--elevation-1: 0 1px 2px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
--elevation-2: 0 2px 4px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04);
--elevation-3: 0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
--elevation-4: 0 8px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
/* ── State layers ── */
--state-hover: rgba(0, 0, 0, 0.04);
--state-focus: rgba(0, 0, 0, 0.06);
--state-pressed: rgba(0, 0, 0, 0.08);
/* ── Motion (M3 Expressive) ── */
--ease-standard: cubic-bezier(0.2, 0, 0, 1);
--ease-expressive: cubic-bezier(0.34, 1.56, 0.64, 1);
--ease-effects: cubic-bezier(0.4, 0, 0.2, 1);
--duration-fast: 100ms;
--duration-normal: 150ms;
--duration-emphasis: 350ms;
/* ── Legacy aliases (used in component styles) ── */
--c-bg: var(--color-bg);
--c-surface: var(--color-surface);
--c-surface-solid: var(--color-surface);
--c-surface-2: var(--color-surface-raised);
--c-surface-3: var(--color-surface-sunken);
--c-border: var(--color-border);
--c-border-2: var(--color-border-strong);
--c-green: var(--color-accent);
--c-green-dim: var(--color-accent-hover);
--c-green-glow: var(--color-accent-muted);
--c-green-glow-md: rgba(37, 99, 235, 0.12);
--c-pink: var(--color-danger);
--c-yellow: var(--color-warning);
--c-blue: var(--color-accent);
--c-text: var(--color-text);
--c-text-2: var(--color-text-secondary);
--c-text-3: var(--color-text-tertiary);
}
/* --- Reset --- */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
}
html {
scroll-behavior: smooth;
}
body {
background: var(--color-bg);
color: var(--color-text);
font-family: var(--font-sans);
font-weight: var(--weight-normal);
font-size: var(--text-base);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
overflow-x: hidden;
}
/* --- Accessibility: Skip Nav --- */
.skip-link {
position: absolute;
top: -100px;
left: 1rem;
background: var(--accent-8);
color: #fff;
padding: 12px 16px;
min-height: 44px;
display: inline-flex;
align-items: center;
border-radius: var(--radius-sm);
font-size: var(--text-sm);
font-weight: 600;
z-index: 100;
text-decoration: none;
}
.skip-link:focus-visible {
top: 1rem;
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
/* --- Global Focus Styles --- */
button, a, input, select, textarea, [tabindex] {
outline: 2px solid transparent;
outline-offset: 2px;
}
:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
/* --- Screen Reader Only --- */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* --- Page Container --- */
.page {
max-width: 1200px;
margin: 0 auto;
padding: 0 clamp(1.5rem, 5vw, 3rem) 8rem;
}
/* ============================================================
HERO
============================================================ */
.hero {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
position: relative;
min-height: 100vh;
min-height: 100dvh;
padding: 0;
}
.hero::before {
display: none;
}
.hero-pill {
display: inline-flex;
align-items: center;
gap: var(--space-2);
background: var(--color-accent-subtle);
border: 1px solid var(--accent-3);
border-radius: var(--radius-pill);
padding: 6px 16px;
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: var(--weight-medium);
color: var(--color-accent);
letter-spacing: 0.01em;
margin-bottom: var(--space-8);
position: relative;
}
.hero-pill .pill-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--color-accent);
}
.hero h1 {
font-family: var(--font-sans);
font-size: clamp(2.5rem, 8vw, 4.5rem);
font-weight: var(--weight-bold);
letter-spacing: -0.045em;
line-height: 1;
position: relative;
color: var(--color-text);
}
.hero-sub {
color: var(--color-text-secondary);
font-family: var(--font-sans);
font-size: clamp(1rem, 1.8vw, 1.125rem);
font-weight: var(--weight-normal);
line-height: var(--leading-relaxed);
margin-top: var(--space-5);
max-width: 48ch;
position: relative;
}
/* Stats row */
.hero-stats {
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-4);
margin-top: var(--space-8);
}
.hero-stat {
font-size: var(--text-base);
color: var(--color-text-secondary);
}
.hero-stat petty-counter {
font-weight: var(--weight-bold);
font-variant-numeric: tabular-nums;
color: var(--color-text);
}
.hero-stat-dot {
width: 4px;
height: 4px;
border-radius: 50%;
background: var(--color-border-strong);
color: var(--color-border-strong);
font-size: 0;
}
/* Custom element display */
petty-typewriter {
display: inline;
}
petty-reveal {
display: block;
}
petty-counter {
font-variant-numeric: tabular-nums;
}
/* ============================================================
MANIFESTO
============================================================ */
.manifesto {
padding: var(--space-16) 0 var(--space-20);
border-top: 1px solid var(--color-border);
}
.manifesto-inner {
max-width: 60ch;
}
.manifesto-kicker {
font-family: var(--font-mono);
font-size: var(--text-xs);
color: var(--color-text-tertiary);
margin-bottom: var(--space-6);
letter-spacing: 0.04em;
}
.manifesto-heading {
font-family: var(--font-sans);
font-size: clamp(1.5rem, 3.5vw, 2rem);
font-weight: var(--weight-bold);
letter-spacing: -0.03em;
line-height: var(--leading-tight);
color: var(--color-text);
margin-bottom: var(--space-10);
}
.manifesto-body {
display: flex;
flex-direction: column;
gap: var(--space-5);
}
.manifesto-body p {
font-size: var(--text-base);
line-height: 1.75;
color: var(--color-text-secondary);
max-width: 60ch;
}
.manifesto-body code {
font-family: var(--font-mono);
font-size: 0.9em;
background: var(--color-surface-raised);
padding: 2px 6px;
border-radius: var(--radius-xs);
color: var(--color-text);
}
.manifesto-body em {
font-style: italic;
color: var(--color-text);
}
/* ============================================================
VALUE PROPS
============================================================ */
.value-props {
margin-top: 0;
padding: var(--space-16) 0;
border-top: 1px solid var(--color-border);
}
.value-list {
display: flex;
gap: var(--space-12);
margin: 0;
}
.value-item {
flex: 1;
min-width: 0;
}
.value-item:nth-child(2) {
flex: 1.15;
}
.value-item dt {
font-size: var(--text-lg);
font-weight: var(--weight-semibold);
color: var(--color-text);
margin-bottom: var(--space-2);
}
.value-item dd {
margin: 0;
font-size: var(--text-base);
color: var(--color-text-secondary);
line-height: var(--leading-relaxed);
}
/* ============================================================
SECTIONS
============================================================ */
/* Separator between major areas */
.section-separator {
position: relative;
height: 1px;
margin: 0;
}
.section-separator::before {
content: "";
position: absolute;
left: 50%;
top: 0;
transform: translateX(-50%);
width: 100%;
max-width: 600px;
height: 1px;
background: linear-gradient(
90deg,
transparent 0%,
var(--c-border-2) 30%,
var(--c-border-2) 70%,
transparent 100%
);
}
/* Ambient gradient between sections */
.section-glow {
position: relative;
}
.section-glow::before {
display: none;
}
.section {
margin-top: 96px;
position: relative;
}
.section-title {
font-family: var(--font-sans);
font-size: clamp(1.75rem, 4vw, 2.5rem);
font-weight: var(--weight-bold);
letter-spacing: -0.035em;
line-height: var(--leading-tight);
color: var(--color-text);
}
.section-desc {
font-family: var(--font-sans);
font-size: var(--text-lg);
font-weight: var(--weight-normal);
color: var(--color-text-secondary);
margin-top: var(--space-3);
max-width: 50ch;
margin-bottom: 40px;
max-width: 48ch;
line-height: 1.6;
}
/* ============================================================
CARD GRID
============================================================ */
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
gap: var(--space-6);
}
.demo-card {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-8);
box-shadow: var(--elevation-2);
}
.demo-card h3 {
font-family: var(--font-sans);
font-size: var(--text-lg);
font-weight: var(--weight-semibold);
color: var(--color-text);
margin-bottom: var(--space-5);
padding-bottom: var(--space-4);
border-bottom: 1px solid var(--color-border);
}
.demo-card .tag-name {
font-family: var(--font-mono);
font-size: var(--text-xs);
font-weight: var(--weight-normal);
color: var(--color-text-tertiary);
margin-top: var(--space-6);
}
.demo-area {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.demo-row {
display: flex;
align-items: center;
gap: var(--space-3);
flex-wrap: wrap;
}
.demo-row-loose {
display: flex;
align-items: center;
gap: var(--space-4);
flex-wrap: wrap;
}
.demo-row-spacious {
display: flex;
align-items: flex-end;
gap: var(--space-6);
flex-wrap: wrap;
}
.wide {
grid-column: 1 / -1;
}
.muted-sm {
color: var(--c-text-3);
font-size: var(--text-xs);
}
/* ============================================================
FOOTER
============================================================ */
.footer-section {
text-align: center;
padding-top: 48px;
margin-top: 128px;
}
.footer-text {
margin-top: 24px;
font-size: var(--text-sm);
color: var(--c-text-3);
max-width: 65ch;
margin-left: auto;
margin-right: auto;
}
.st3-sig {
text-align: right;
padding: 48px 0 16px;
font-family: var(--font-mono);
font-size: var(--text-xs);
color: var(--c-text-3);
letter-spacing: 0.2em;
opacity: 0.5;
}
/* ============================================================
COMPONENT STYLES: Buttons
============================================================ */
petty-button button {
background: var(--color-surface);
border: 1px solid var(--color-border-strong);
border-radius: var(--radius-pill);
color: var(--color-text);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: var(--weight-medium);
padding: 0 24px;
line-height: 1;
height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background var(--duration-normal) var(--ease-effects), border-color var(--duration-fast), box-shadow var(--duration-normal) var(--ease-effects);
}
petty-button button:hover {
background: var(--color-surface-raised);
box-shadow: var(--elevation-1);
}
petty-button button:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-button button:disabled, petty-button[disabled] button {
opacity: 0.38;
cursor: not-allowed;
}
petty-button[data-state="loading"] button {
opacity: 0.38;
cursor: wait;
}
petty-button button.primary {
background: var(--accent-7);
border-color: var(--accent-7);
color: var(--accent-contrast);
font-weight: var(--weight-medium);
box-shadow: var(--elevation-1);
}
petty-button button.primary:hover {
background: var(--accent-8);
border-color: var(--accent-8);
box-shadow: var(--elevation-2);
}
.btn-outline {
background: var(--color-surface);
border: 1px solid var(--color-border-strong);
color: var(--color-text);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: var(--weight-medium);
padding: 0 24px;
height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-pill);
transition: background var(--duration-normal) var(--ease-effects), box-shadow var(--duration-normal);
}
.btn-outline:hover {
background: var(--color-surface-raised);
box-shadow: var(--elevation-1);
}
.btn-outline:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
.hint-text {
cursor: help;
border-bottom: 1px dashed var(--c-text-3);
color: var(--c-text-2);
font-size: var(--text-sm);
padding-bottom: 2px;
}
/* ============================================================
COMPONENT STYLES: Badge & Avatar
============================================================ */
petty-badge {
display: inline-flex;
align-items: center;
font-family: var(--font-mono);
font-size: var(--text-xs);
height: 32px;
font-weight: 500;
padding: 3px 12px;
border-radius: var(--radius-md);
border: 1px solid var(--c-border-2);
background: var(--c-surface-2);
color: var(--c-text-2);
}
petty-badge[data-variant="success"] {
border-color: rgba(34, 197, 94, 0.3);
color: var(--color-success);
background: var(--color-success-subtle);
}
petty-badge[data-variant="error"] {
border-color: rgba(244, 63, 94, 0.3);
color: var(--c-pink);
background: rgba(244, 63, 94, 0.08);
}
petty-badge[data-variant="warning"] {
border-color: rgba(234, 179, 8, 0.3);
color: var(--c-yellow);
background: rgba(234, 179, 8, 0.08);
}
petty-avatar {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--c-surface-3);
color: var(--c-text-2);
font-family: var(--font-sans);
font-size: var(--text-xs);
font-weight: 600;
}
petty-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
/* ============================================================
COMPONENT STYLES: Separator
============================================================ */
petty-separator {
display: block;
height: 1px;
background: var(--c-border);
margin: 12px 0;
}
/* ============================================================
COMPONENT STYLES: Skeleton & Card
============================================================ */
petty-skeleton {
display: block;
height: 0.75rem;
border-radius: var(--radius-sm);
background: var(--gray-3);
animation: shimmer 1s var(--ease-standard) infinite alternate;
}
@keyframes shimmer {
0% { opacity: 0.6; }
100% { opacity: 1; }
}
.skeleton-stack {
display: flex;
flex-direction: column;
gap: 8px;
}
.skel-80 {
width: 80%;
height: 10px;
border-radius: 4px;
}
.skel-60 {
width: 60%;
height: 10px;
border-radius: 4px;
}
.skel-70 {
width: 70%;
height: 10px;
border-radius: 4px;
}
.skel-btn {
width: 5rem;
height: 2.75rem;
border-radius: var(--radius-sm);
}
petty-card {
display: block;
border: 1px solid var(--c-border);
border-radius: var(--radius-lg);
background: var(--c-surface);
overflow: hidden;
}
petty-card-header {
display: block;
padding: 20px 20px 0;
}
petty-card-header h4 {
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 600;
}
petty-card-content {
display: flex;
flex-direction: column;
gap: 8px;
padding: 12px 20px;
color: var(--c-text-2);
font-size: var(--text-sm);
}
petty-card-footer {
display: flex;
gap: 8px;
padding: 0 20px 20px;
}
/* ============================================================
COMPONENT STYLES: Text Field
============================================================ */
petty-text-field {
display: flex;
flex-direction: column;
gap: 6px;
}
petty-text-field [data-part="label"] {
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
color: var(--c-text-2);
}
petty-text-field input[data-part="control"] {
background: var(--c-bg);
border: 1px solid var(--c-border-2);
border-radius: var(--radius-sm);
color: var(--c-text);
font-family: var(--font-sans);
font-size: var(--text-base);
padding: 16px;
height: 56px;
transition: border-color var(--duration-fast) var(--ease-effects), box-shadow var(--duration-fast) var(--ease-effects);
}
petty-text-field input:focus-visible {
border-color: var(--color-accent);
border-width: 2px;
padding: 15px;
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-text-field [data-part="error"] {
color: var(--c-pink);
font-size: var(--text-xs);
min-height: 0.875rem;
}
petty-text-field [data-part="description"] {
color: var(--c-text-3);
font-size: var(--text-xs);
}
/* ============================================================
COMPONENT STYLES: Checkbox & Switch
============================================================ */
petty-checkbox {
display: inline-flex;
align-items: center;
gap: 8px;
cursor: pointer;
min-height: 48px;
}
petty-checkbox input[data-part="control"] {
appearance: none;
width: 20px;
height: 20px;
border: 1.5px solid var(--c-border-2);
border-radius: var(--radius-xs);
background: var(--c-bg);
cursor: pointer;
font-size: var(--text-base);
transition: background var(--duration-fast) var(--ease-effects), border-color var(--duration-fast) var(--ease-effects), transform var(--duration-normal) var(--ease-expressive);
}
petty-checkbox input:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-checkbox input:checked {
background: var(--color-accent);
border-color: var(--color-accent);
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
background-size: 12px;
background-position: center;
background-repeat: no-repeat;
transform: scale(1.1);
}
petty-checkbox input:not(:checked) {
transform: scale(1);
}
petty-checkbox [data-part="label"] {
font-family: var(--font-sans);
font-size: var(--text-sm);
color: var(--c-text-2);
cursor: pointer;
}
petty-switch {
display: inline-flex;
align-items: center;
gap: 12px;
min-height: 48px;
}
petty-switch button[data-part="control"] {
position: relative;
width: 52px;
height: 32px;
border-radius: 16px;
border: none;
background: var(--c-surface-3);
cursor: pointer;
transition: background var(--duration-normal) var(--ease-effects);
padding: 0;
}
petty-switch button[data-part="control"]:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-switch[data-state="on"] button[data-part="control"] {
background: var(--c-green);
}
petty-switch [data-part="thumb"] {
display: block;
width: 16px;
height: 16px;
border-radius: 50%;
background: white;
color: var(--color-text);
position: absolute;
top: 8px;
left: 6px;
transition: transform var(--duration-normal) var(--ease-expressive), width var(--duration-normal) var(--ease-expressive), height var(--duration-normal) var(--ease-expressive), top var(--duration-normal) var(--ease-expressive);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
petty-switch[data-state="on"] [data-part="thumb"] {
width: 24px;
height: 24px;
top: 4px;
transform: translateX(22px);
}
petty-switch [data-part="label"] {
font-family: var(--font-sans);
font-size: var(--text-sm);
color: var(--c-text-2);
}
/* ============================================================
COMPONENT STYLES: Radio Group
============================================================ */
petty-radio-group {
display: flex;
flex-direction: column;
gap: 6px;
}
petty-radio-item {
display: inline-flex;
align-items: center;
gap: 8px;
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-sm);
color: var(--c-text-2);
padding: 4px 0;
min-height: 48px;
transition: color var(--duration-fast) var(--ease-effects);
}
petty-radio-item[data-state="checked"] {
color: var(--c-text);
}
petty-radio-item::before {
content: "";
width: 20px;
height: 20px;
border-radius: 50%;
border: 1.5px solid var(--c-border-2);
background: var(--c-bg);
transition: border-color var(--duration-fast) var(--ease-effects), border-width var(--duration-normal) var(--ease-expressive);
flex-shrink: 0;
}
petty-radio-item[data-state="checked"]::before {
border-color: var(--c-green);
border-width: 5px;
}
/* ============================================================
COMPONENT STYLES: Toggle & Toggle Group
============================================================ */
petty-toggle button[data-part="control"] {
background: var(--color-surface);
border: 1px solid var(--color-border-strong);
border-radius: var(--radius-pill);
color: var(--color-text-secondary);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: var(--weight-medium);
padding: 0 20px;
height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background var(--duration-normal) var(--ease-effects), border-color var(--duration-normal) var(--ease-effects), color var(--duration-normal) var(--ease-effects);
}
petty-toggle button[data-part="control"]:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-toggle[data-state="on"] button[data-part="control"] {
background: var(--color-accent-subtle);
border-color: var(--color-accent);
color: var(--color-accent);
}
petty-toggle-group {
display: inline-flex;
border-radius: var(--radius-pill);
overflow: hidden;
border: 1px solid var(--color-border-strong);
}
petty-toggle-group-item {
background: var(--color-surface);
border: none;
border-right: 1px solid var(--color-border);
color: var(--color-text-secondary);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: var(--weight-medium);
padding: 0 20px;
height: 44px;
flex: 1;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background var(--duration-fast) var(--ease-effects), color var(--duration-fast) var(--ease-effects);
}
petty-toggle-group-item:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: -2px;
}
petty-toggle-group-item:last-child {
border-right: none;
}
petty-toggle-group-item[data-state="on"] {
background: var(--accent-7);
color: var(--accent-contrast);
}
/* ============================================================
COMPONENT STYLES: Slider & Number Field
============================================================ */
petty-slider {
display: flex;
flex-direction: column;
gap: 8px;
}
petty-slider [data-part="label"] {
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
color: var(--c-text-2);
}
petty-slider input[type="range"] {
-webkit-appearance: none;
appearance: none;
font-size: var(--text-base);
width: 100%;
height: 6px;
background: var(--color-surface-sunken);
border-radius: var(--radius-pill);
}
petty-slider input[type="range"]:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 4px;
}
petty-slider input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--color-accent);
cursor: pointer;
box-shadow: var(--elevation-2);
transition: transform var(--duration-normal) var(--ease-expressive);
}
petty-slider input[type="range"]::-webkit-slider-thumb:hover {
transform: scale(1.15);
}
petty-slider input[type="range"]:active::-webkit-slider-thumb {
transform: scale(1.25);
}
petty-slider [data-part="output"] {
font-family: var(--font-mono);
font-size: var(--text-sm);
color: var(--c-text-2);
align-self: flex-end;
}
petty-number-field {
display: inline-flex;
align-items: center;
}
petty-number-field [data-part="label"] {
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
color: var(--c-text-2);
margin-right: 12px;
}
petty-number-field button {
background: var(--c-surface-2);
border: 1px solid var(--c-border-2);
color: var(--c-text-2);
cursor: pointer;
font-size: var(--text-sm);
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
transition: background var(--duration-fast) var(--ease-effects), color var(--duration-fast) var(--ease-effects);
}
petty-number-field button:hover {
background: var(--c-surface-3);
color: var(--c-text);
}
petty-number-field button:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: -2px;
}
petty-number-field [data-part="decrement"] {
border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
petty-number-field [data-part="increment"] {
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
petty-number-field input[data-part="control"] {
-moz-appearance: textfield;
appearance: textfield;
background: var(--c-bg);
border: 1px solid var(--c-border-2);
border-left: none;
border-right: none;
color: var(--c-text);
font-family: var(--font-mono);
font-size: var(--text-base);
text-align: center;
width: 48px;
height: 44px;
}
petty-number-field input:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: -2px;
}
petty-number-field input::-webkit-inner-spin-button,
petty-number-field input::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* ============================================================
COMPONENT STYLES: Tags Input
============================================================ */
petty-tags-input {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
background: var(--c-bg);
border: 1px solid var(--c-border-2);
border-radius: var(--radius-sm);
padding: 6px 10px;
transition: border-color var(--duration-fast) var(--ease-effects), box-shadow var(--duration-fast) var(--ease-effects);
}
petty-tags-input:focus-within {
border-color: var(--c-green);
box-shadow: 0 0 0 3px var(--c-green-glow);
}
petty-tags-input [data-part="tags"] {
display: contents;
}
petty-tags-input [data-part="tag"] {
display: inline-flex;
align-items: center;
gap: 4px;
background: var(--c-green-glow);
border: 1px solid rgba(34, 197, 94, 0.2);
border-radius: 4px;
color: var(--c-green);
font-family: var(--font-mono);
font-size: var(--text-xs);
font-weight: 500;
padding: 2px 8px;
}
petty-tags-input [data-part="tag-remove"] {
background: none;
border: none;
color: var(--c-green-dim);
cursor: pointer;
font-size: var(--text-sm);
padding: 4px;
min-width: 24px;
min-height: 24px;
display: inline-flex;
align-items: center;
justify-content: center;
line-height: 1;
border-radius: var(--radius-xs);
}
petty-tags-input [data-part="tag-remove"]:hover {
color: var(--c-pink);
}
petty-tags-input input[data-part="input"] {
background: transparent;
border: none;
color: var(--c-text);
font-family: var(--font-sans);
font-size: var(--text-base);
flex: 1;
min-width: 80px;
padding: 4px 0;
}
petty-tags-input input[data-part="input"]::placeholder {
color: var(--c-text-3);
}
/* ============================================================
COMPONENT STYLES: Select
============================================================ */
petty-select {
display: inline-block;
}
petty-select [data-part="trigger"] {
background: var(--c-surface-2);
border: 1px solid var(--c-border-2);
border-radius: var(--radius-sm);
color: var(--c-text-2);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-sm);
padding: 12px 16px;
min-width: 150px;
height: 44px;
text-align: left;
anchor-name: --petty-select-anchor;
transition: border-color var(--duration-fast) var(--ease-effects);
}
petty-select [data-part="trigger"]:hover {
border-color: var(--c-text-3);
}
petty-select [data-part="trigger"]:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-select [data-part="listbox"] {
background: var(--c-surface-2);
border: 1px solid var(--c-border-2);
border-radius: var(--radius-md);
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
min-width: 150px;
padding: 4px;
margin: 0;
position-anchor: --petty-select-anchor;
inset: unset;
top: anchor(bottom);
left: anchor(left);
margin-top: 4px;
}
petty-select-option {
display: block;
border-radius: var(--radius-xs);
color: var(--c-text-2);
cursor: pointer;
font-size: var(--text-sm);
padding: 8px 10px;
transition: background var(--duration-fast) var(--ease-effects), color var(--duration-fast) var(--ease-effects);
}
petty-select-option:hover,
petty-select-option[data-highlighted] {
background: var(--c-surface-3);
color: var(--c-text);
}
petty-select-option[aria-selected="true"] {
color: var(--c-green);
}
/* ============================================================
COMPONENT STYLES: Tabs
============================================================ */
[role="tablist"] {
display: flex;
border-bottom: 1px solid var(--c-border);
gap: 0;
}
petty-tab {
background: none;
border: none;
border-bottom: 3px solid transparent;
color: var(--c-text-3);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
margin-bottom: -1px;
padding: 12px 16px;
height: 48px;
display: inline-flex;
align-items: center;
transition: color var(--duration-fast) var(--ease-effects), border-color var(--duration-fast) var(--ease-effects);
}
petty-tab:hover {
color: var(--c-text-2);
}
petty-tab:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: -2px;
}
petty-tab[data-state="active"] {
color: var(--c-text);
border-bottom-color: var(--c-green);
}
petty-tab-panel {
display: block;
padding: 20px 0;
color: var(--c-text-2);
font-size: var(--text-sm);
line-height: 1.7;
max-width: 65ch;
}
petty-tab-panel[hidden] {
display: none;
}
/* ============================================================
COMPONENT STYLES: Accordion
============================================================ */
petty-accordion {
display: flex;
flex-direction: column;
}
petty-accordion-item {
display: block;
border-bottom: 1px solid var(--c-border);
}
petty-accordion-item summary {
color: var(--c-text-2);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
list-style: none;
padding: 16px 0;
min-height: 48px;
display: flex;
align-items: center;
transition: color var(--duration-fast) var(--ease-effects);
}
petty-accordion-item summary:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-accordion-item summary::-webkit-details-marker {
display: none;
}
petty-accordion-item details[open] summary {
color: var(--c-text);
}
petty-accordion-item [data-part="content"] {
color: var(--c-text-3);
font-size: var(--text-sm);
padding-bottom: 16px;
line-height: 1.7;
}
/* ============================================================
COMPONENT STYLES: Breadcrumbs & Pagination
============================================================ */
petty-breadcrumbs {
display: flex;
align-items: center;
}
petty-breadcrumbs ol {
display: flex;
align-items: center;
list-style: none;
padding: 0;
margin: 0;
}
petty-breadcrumb-item {
display: inline-flex;
align-items: center;
font-size: var(--text-sm);
}
petty-breadcrumb-item::after {
content: "/";
color: var(--c-text-3);
margin: 0 8px;
}
petty-breadcrumb-item:last-child::after {
display: none;
}
petty-breadcrumb-item a {
color: var(--c-text-3);
text-decoration: none;
transition: color var(--duration-fast) var(--ease-effects);
}
petty-breadcrumb-item a:hover {
color: var(--c-text);
}
petty-breadcrumb-item[data-state="current"] {
color: var(--c-text);
font-weight: 500;
}
petty-pagination nav {
display: flex;
align-items: center;
gap: 4px;
min-height: 44px;
flex-wrap: wrap;
}
petty-pagination-item {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 36px;
height: 36px;
border-radius: var(--radius-sm);
background: var(--c-surface-2);
border: 1px solid var(--c-border);
color: var(--c-text-3);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
padding: 0 8px;
transition: background var(--duration-fast) var(--ease-effects), color var(--duration-fast) var(--ease-effects);
}
petty-pagination-item:hover {
background: var(--c-surface-3);
color: var(--c-text);
}
petty-pagination-item:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
petty-pagination-item[data-state="active"] {
background: var(--c-text);
color: var(--c-bg);
border-color: var(--c-text);
}
petty-pagination-item[disabled] {
opacity: 0.38;
cursor: not-allowed;
}
/* ============================================================
COMPONENT STYLES: Dialog
============================================================ */
dialog {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-xl);
box-shadow: var(--elevation-4);
color: var(--color-text);
max-width: min(90vw, 28rem);
padding: var(--space-8);
margin: auto;
inset: 0;
position: fixed;
}
dialog::backdrop {
background: rgba(15, 23, 42, 0.5);
}
dialog h2 {
font-family: var(--font-sans);
font-size: var(--text-lg);
font-weight: 600;
margin-bottom: 8px;
}
dialog p {
color: var(--c-text-2);
font-size: var(--text-sm);
margin-bottom: 24px;
line-height: 1.7;
}
/* ============================================================
COMPONENT STYLES: Popover & Tooltip
============================================================ */
[popover] {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
box-shadow: var(--elevation-3);
color: var(--color-text);
font-size: var(--text-base);
padding: var(--space-4) var(--space-5);
margin: 0;
}
petty-popover {
display: inline-block;
}
petty-popover button[popovertarget] {
anchor-name: --popover-anchor;
}
petty-popover [popover] {
position-anchor: --popover-anchor;
inset: unset;
top: anchor(bottom);
left: anchor(left);
margin-top: 6px;
}
petty-tooltip {
display: inline-block;
}
petty-tooltip [data-part="trigger"] {
anchor-name: --tooltip-anchor;
}
petty-tooltip [data-part="content"] {
background: var(--c-text);
color: var(--c-bg);
font-size: var(--text-xs);
font-weight: 500;
padding: 6px 12px;
border: none;
border-radius: var(--radius-xs);
position-anchor: --tooltip-anchor;
inset: unset;
top: anchor(bottom);
left: anchor(center);
translate: -50% 0;
margin-top: 6px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* ============================================================
COMPONENT STYLES: Dropdown Menu
============================================================ */
petty-dropdown-menu {
display: inline-block;
}
petty-dropdown-menu [data-part="trigger"] {
anchor-name: --menu-anchor;
}
petty-dropdown-menu [data-part="content"] {
min-width: 10rem;
padding: 4px;
border-radius: 4px;
position-anchor: --menu-anchor;
inset: unset;
top: anchor(bottom);
left: anchor(left);
margin-top: 4px;
}
petty-menu-item {
display: block;
border-radius: var(--radius-xs);
color: var(--c-text-2);
cursor: pointer;
font-size: var(--text-sm);
padding: 8px 10px;
transition: background var(--duration-fast) var(--ease-effects), color var(--duration-fast) var(--ease-effects);
}
petty-menu-item:hover,
petty-menu-item:focus {
background: var(--c-surface-3);
color: var(--c-text);
}
petty-menu-item[disabled] {
color: var(--c-text-3);
opacity: 0.38;
cursor: not-allowed;
}
petty-menu-item[disabled]:hover {
background: transparent;
color: var(--c-text-3);
}
/* ============================================================
COMPONENT STYLES: Alert
============================================================ */
petty-alert {
display: flex;
align-items: flex-start;
gap: var(--space-3);
padding: var(--space-4) var(--space-5);
border-radius: var(--radius-lg);
border: 1px solid var(--color-border);
background: var(--color-surface);
font-size: var(--text-base);
}
petty-alert[data-variant="success"] {
border-color: #bbf7d0;
background: var(--color-success-subtle);
}
petty-alert[data-variant="error"] {
border-color: #fecaca;
background: var(--color-danger-subtle);
}
petty-alert[data-variant="warning"] {
border-color: #fde68a;
background: var(--color-warning-subtle);
}
.alert-icon {
flex-shrink: 0;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--text-sm);
margin-top: 1px;
}
petty-alert[data-variant="success"] .alert-icon { color: var(--color-success); }
petty-alert[data-variant="error"] .alert-icon { color: var(--color-danger); }
petty-alert[data-variant="warning"] .alert-icon { color: var(--color-warning); }
petty-alert [data-part="title"] {
font-weight: var(--weight-semibold);
font-size: var(--text-base);
margin-bottom: var(--space-1);
color: var(--color-text);
}
petty-alert [data-part="description"] {
color: var(--color-text-secondary);
font-size: var(--text-sm);
line-height: var(--leading-relaxed);
}
/* ============================================================
COMPONENT STYLES: Progress & Meter
============================================================ */
petty-progress { display: block; }
petty-meter { display: block; }
.progress-field {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.progress-header {
display: flex;
justify-content: space-between;
font-size: var(--text-sm);
color: var(--color-text);
font-weight: var(--weight-medium);
}
.progress-header .meter-low { color: var(--color-success); }
.progress-header .meter-high { color: var(--color-danger); }
petty-progress [data-part="track"],
petty-meter [data-part="track"] {
height: 10px;
background: var(--color-surface-sunken);
border-radius: var(--radius-pill);
overflow: hidden;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
petty-progress [data-part="fill"] {
height: 100%;
background: var(--color-accent);
border-radius: var(--radius-pill);
width: calc(var(--petty-progress, 0) * 100%);
}
petty-progress [data-part="label"] { display: none; }
petty-meter [data-part="fill"] {
height: 100%;
border-radius: var(--radius-pill);
width: calc(var(--petty-meter-value, 0) * 100%);
}
petty-meter[data-state="low"] [data-part="fill"] { background: var(--color-danger); }
petty-meter[data-state="medium"] [data-part="fill"] { background: var(--color-warning); }
petty-meter[data-state="high"] [data-part="fill"] { background: var(--color-success); }
petty-meter[data-state="optimum"] [data-part="fill"] { background: var(--color-accent); }
/* ============================================================
COMPONENT STYLES: Toast
============================================================ */
petty-toast-region {
position: fixed;
bottom: 24px;
right: 24px;
display: flex;
flex-direction: column;
gap: 8px;
max-width: 22rem;
width: 100%;
z-index: 9997;
pointer-events: none;
}
[data-part="toast"] {
background: var(--color-surface);
color: var(--color-text);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 32px rgba(0, 0, 0, 0.06);
display: grid;
grid-template-columns: 1fr auto;
gap: var(--space-1);
padding: 16px;
pointer-events: auto;
animation: toastIn 0.4s var(--ease-expressive);
}
[data-part="toast"][data-type="success"] {
background: var(--color-success-subtle);
border-color: #bbf7d0;
}
[data-part="toast"][data-type="error"] {
background: var(--color-danger-subtle);
border-color: #fecaca;
}
[data-part="toast-title"] {
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: var(--weight-semibold);
line-height: 1.4;
}
[data-part="toast"][data-type="success"] [data-part="toast-title"] { color: var(--color-success); }
[data-part="toast"][data-type="error"] [data-part="toast-title"] { color: var(--color-danger); }
[data-part="toast-description"] {
color: var(--color-text-secondary);
font-size: var(--text-sm);
line-height: 1.5;
grid-column: 1;
}
[data-part="toast-close"] {
background: none;
border: none;
color: var(--color-text-tertiary);
cursor: pointer;
font-size: var(--text-base);
padding: 8px;
min-width: 44px;
min-height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
line-height: 1;
grid-row: 1;
grid-column: 2;
align-self: start;
transition: color var(--duration-fast);
border-radius: var(--radius-sm);
}
[data-part="toast-close"]:hover {
color: var(--color-text);
}
@keyframes toastIn {
from {
transform: translateY(100%) scale(0.9);
opacity: 0;
}
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
/* ============================================================
COMPONENT STYLES: Link & Collapsible
============================================================ */
petty-link a {
color: var(--c-green);
text-decoration: none;
font-size: var(--text-sm);
transition: opacity var(--duration-fast) var(--ease-effects);
}
petty-link a:hover {
opacity: 0.8;
}
petty-collapsible summary {
color: var(--c-text-2);
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-sm);
font-weight: 500;
list-style: none;
padding: 8px 0;
}
petty-collapsible summary::-webkit-details-marker {
display: none;
}
petty-collapsible [data-part="content"] {
color: var(--c-text-3);
font-size: var(--text-sm);
padding: 8px 0;
line-height: 1.7;
}
/* ============================================================
RESPONSIVE
============================================================ */
@media (max-width: 768px) {
.hero-stats {
flex-wrap: wrap;
}
.grid {
grid-template-columns: 1fr;
}
.value-list {
flex-direction: column;
gap: var(--space-8);
}
.section {
margin-top: 64px;
}
.footer-section {
margin-top: 80px;
}
.hero {
min-height: 100vh;
min-height: 100dvh;
padding: 0;
}
}