/**
 * PCP (Paperclip Punk) Design System
 * A minimalist design system with sharp aesthetics and layered depth
 */

/* ============================================
   FONT IMPORTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* JetBrains Mono for code blocks */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Bold.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   DESIGN TOKENS - LIGHT MODE
   ============================================ */
:root {
    /* Primary Colors */
    --pcp-blue: #2563eb;
    --pcp-orange: #c2410c;
    
    /* Background Hierarchy */
    --pcp-bg-0: #ffffff;
    --pcp-bg-1: #f8f9fc;
    --pcp-bg-2: #edf1fa;
    
    /* Text Colors */
    --pcp-text-strong: #171717;
    --pcp-text-muted: #525252;
    
    /* Status Colors */
    --pcp-success: #15803d;
    --pcp-warning: #a16207;
    --pcp-error: #dc2626;
    
    /* Border Colors */
    --pcp-border-light: #e5e7eb;
    --pcp-border-default: #d1d5db;
    
    /* Spacing System (8px grid) */
    --pcp-grid: 8px;
    --pcp-space-1: 8px;
    --pcp-space-2: 16px;
    --pcp-space-3: 24px;
    --pcp-space-4: 32px;
    --pcp-space-5: 40px;
    --pcp-space-6: 48px;
    --pcp-space-8: 64px;
    --pcp-space-10: 80px;
    --pcp-space-12: 96px;
    --pcp-space-14: 112px;
    
    /* Typography - Font Families */
    --pcp-font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pcp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pcp-font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    
    /* Typography - Font Sizes */
    --pcp-font-size-xs: 0.75rem;    /* 12px */
    --pcp-font-size-sm: 0.875rem;   /* 14px */
    --pcp-font-size-base: 1rem;     /* 16px */
    --pcp-font-size-lg: 1.125rem;   /* 18px */
    --pcp-font-size-xl: 1.25rem;    /* 20px */
    --pcp-font-size-2xl: 1.5rem;    /* 24px */
    --pcp-font-size-3xl: 1.875rem;  /* 30px */
    --pcp-font-size-4xl: 2.25rem;   /* 36px */
    
    /* Typography - Font Weights */
    --pcp-font-weight-regular: 400;
    --pcp-font-weight-medium: 500;
    --pcp-font-weight-semibold: 600;
    --pcp-font-weight-bold: 700;
    
    /* Typography - Line Heights */
    --pcp-line-height-tight: 1.25;
    --pcp-line-height-base: 1.5;
    --pcp-line-height-relaxed: 1.75;
    
    /* Typography - Letter Spacing */
    --pcp-letter-spacing-tight: -0.025em;
    --pcp-letter-spacing-normal: 0;
    --pcp-letter-spacing-wide: 0.025em;
    
    /* Border Radius */
    --pcp-radius: 2px;
    
    /* Shadows - Standard */
    --pcp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --pcp-shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --pcp-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --pcp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Shadows - Layered (Signature PCP) */
    --pcp-shadow-layered-sm: 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        2px 2px 0 0 var(--pcp-bg-2);
    
    --pcp-shadow-layered-md: 
        0 4px 8px -2px rgba(0, 0, 0, 0.1),
        3px 3px 0 0 var(--pcp-bg-2);
    
    --pcp-shadow-layered-lg:
        0 6px 12px -3px rgba(0, 0, 0, 0.15),
        4px 4px 0 0 var(--pcp-bg-2),
        6px 6px 0 0 var(--pcp-bg-1);
    
    /* Shadows - Colored */
    --pcp-shadow-blue-sm: 0 2px 8px -2px rgba(37, 99, 235, 0.3);
    --pcp-shadow-blue-md: 0 4px 12px -2px rgba(37, 99, 235, 0.4);
    
    /* Transitions */
    --pcp-transition-fast: 120ms ease-out;
    --pcp-transition-base: 180ms ease-out;
    --pcp-transition-slow: 250ms ease-out;
    
    /* Z-index Scale */
    --pcp-z-base: 0;
    --pcp-z-dropdown: 10;
    --pcp-z-sticky: 20;
    --pcp-z-overlay: 30;
    --pcp-z-modal: 40;
    --pcp-z-tooltip: 50;
    
    /* Container Widths */
    --pcp-container-sm: 640px;
    --pcp-container-md: 768px;
    --pcp-container-lg: 1024px;
    --pcp-container-xl: 1280px;
    --pcp-container-2xl: 1440px;
}

/* ============================================
   DESIGN TOKENS - DARK MODE
   ============================================ */
:root[data-theme='dark'] {
    /* Primary Colors */
    --pcp-blue: #3b82f6;
    --pcp-orange: #ea580c;
    
    /* Background Hierarchy */
    --pcp-bg-0: #0a0a0a;
    --pcp-bg-1: #121212;
    --pcp-bg-2: #1e1e1e;
    
    /* Text Colors */
    --pcp-text-strong: #f5f5f5;
    --pcp-text-muted: #a3a3a3;
    
    /* Status Colors */
    --pcp-success: #22c55e;
    --pcp-warning: #f59e0b;
    --pcp-error: #ef4444;
    
    /* Border Colors */
    --pcp-border-light: #262626;
    --pcp-border-default: #404040;
    
    /* Shadows - Adjust for dark mode */
    --pcp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --pcp-shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --pcp-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --pcp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    /* Layered shadows for dark mode */
    --pcp-shadow-layered-sm: 
        0 2px 4px -1px rgba(0, 0, 0, 0.3),
        2px 2px 0 0 var(--pcp-bg-2);
    
    --pcp-shadow-layered-md: 
        0 4px 8px -2px rgba(0, 0, 0, 0.4),
        3px 3px 0 0 var(--pcp-bg-2);
    
    --pcp-shadow-layered-lg:
        0 6px 12px -3px rgba(0, 0, 0, 0.5),
        4px 4px 0 0 var(--pcp-bg-2),
        6px 6px 0 0 var(--pcp-bg-1);
    
    /* Colored shadows for dark mode */
    --pcp-shadow-blue-sm: 0 2px 8px -2px rgba(59, 130, 246, 0.4);
    --pcp-shadow-blue-md: 0 4px 12px -2px rgba(59, 130, 246, 0.5);
}

/* ============================================
   MEDIA QUERIES FOR RESPONSIVE TOKENS
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        /* Apply dark mode tokens automatically */
        --pcp-blue: #3b82f6;
        --pcp-orange: #ea580c;
        --pcp-bg-0: #0a0a0a;
        --pcp-bg-1: #121212;
        --pcp-bg-2: #1e1e1e;
        --pcp-text-strong: #f5f5f5;
        --pcp-text-muted: #a3a3a3;
        --pcp-success: #22c55e;
        --pcp-warning: #f59e0b;
        --pcp-error: #ef4444;
        --pcp-border-light: #262626;
        --pcp-border-default: #404040;
        --pcp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
        --pcp-shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --pcp-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
        --pcp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
        --pcp-shadow-layered-sm: 
            0 2px 4px -1px rgba(0, 0, 0, 0.3),
            2px 2px 0 0 #1e1e1e;
        --pcp-shadow-layered-md: 
            0 4px 8px -2px rgba(0, 0, 0, 0.4),
            3px 3px 0 0 #1e1e1e;
        --pcp-shadow-layered-lg:
            0 6px 12px -3px rgba(0, 0, 0, 0.5),
            4px 4px 0 0 #1e1e1e,
            6px 6px 0 0 #121212;
        --pcp-shadow-blue-sm: 0 2px 8px -2px rgba(59, 130, 246, 0.4);
        --pcp-shadow-blue-md: 0 4px 12px -2px rgba(59, 130, 246, 0.5);
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* Pulsing caret animation */
@keyframes caretPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Subtle fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scale in */
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================
   BASE RESET & NORMALIZE STYLES
   ============================================ */

/* Box sizing reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margins and paddings */
* {
    margin: 0;
    padding: 0;
}

/* Set core root defaults */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    scroll-behavior: smooth;
    line-height: var(--pcp-line-height-base);
    font-family: var(--pcp-font-body);
    font-size: var(--pcp-font-size-base);
    font-weight: var(--pcp-font-weight-regular);
    color: var(--pcp-text-strong);
    background-color: var(--pcp-bg-0);
}

/* Remove list styles */
ul,
ol {
    list-style: none;
}

/* Set shorter line heights on headings */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--pcp-line-height-tight);
    font-family: var(--pcp-font-heading);
    font-weight: var(--pcp-font-weight-semibold);
    letter-spacing: var(--pcp-letter-spacing-tight);
    color: var(--pcp-text-strong);
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Inherit fonts for form elements */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Remove default button styles */
button {
    background: none;
    border: none;
    cursor: pointer;
}

/* Ensure textareas without rows attribute are not tiny */
textarea:not([rows]) {
    min-height: 10em;
}

/* Clickable elements should have pointer cursor */
button,
[role="button"],
input[type="submit"],
input[type="button"],
label[for],
select,
summary {
    cursor: pointer;
}

/* Remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--pcp-blue);
    outline-offset: 2px;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Text selection styling */
::selection {
    background-color: var(--pcp-blue);
    color: white;
}

/* Links default styling */
a {
    color: var(--pcp-blue);
    text-decoration: none;
    transition: color var(--pcp-transition-fast);
}

a:not(.nav-link):not(.site-nav-link):not(.blog-nav-title):not(.link-animated):not(.post-title-link):not(.social-link):not(.btn):not(.btn-secondary) {
    position: relative;
    padding-bottom: 2px;
}

a:not(.nav-link):not(.site-nav-link):not(.blog-nav-title):not(.link-animated):not(.post-title-link):not(.social-link):not(.btn):not(.btn-secondary)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--pcp-orange);
    transition: width var(--pcp-transition-fast);
}

a:not(.nav-link):not(.site-nav-link):not(.blog-nav-title):not(.link-animated):not(.post-title-link):not(.social-link):not(.btn):not(.btn-secondary):hover::after {
    width: 100%;
}

/* Code and pre elements */
code,
pre,
kbd,
samp {
    font-family: var(--pcp-font-mono);
    font-size: 0.95em;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--pcp-border-light);
    margin: var(--pcp-space-4) 0;
}

/* Table styles */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Blockquote */
blockquote {
    padding-left: var(--pcp-space-3);
    border-left: 3px solid var(--pcp-blue);
    font-style: italic;
    color: var(--pcp-text-muted);
}

/* Details/Summary */
details summary {
    cursor: pointer;
}

details summary::-webkit-details-marker {
    color: var(--pcp-blue);
}

/* Disabled state */
:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Hidden attribute support */
[hidden] {
    display: none !important;
}

/* ============================================
   TYPOGRAPHY SCALE & SETTINGS
   ============================================ */

/* Heading Scales */
h1, .h1 {
    font-size: var(--pcp-font-size-4xl);
    font-weight: var(--pcp-font-weight-bold);
    line-height: var(--pcp-line-height-tight);
    letter-spacing: var(--pcp-letter-spacing-tight);
    margin-bottom: var(--pcp-space-3);
}

h2, .h2 {
    font-size: var(--pcp-font-size-3xl);
    font-weight: var(--pcp-font-weight-semibold);
    line-height: var(--pcp-line-height-tight);
    letter-spacing: var(--pcp-letter-spacing-tight);
    margin-bottom: var(--pcp-space-3);
}

h3, .h3 {
    font-size: var(--pcp-font-size-2xl);
    font-weight: var(--pcp-font-weight-semibold);
    line-height: var(--pcp-line-height-tight);
    margin-bottom: var(--pcp-space-2);
}

h4, .h4 {
    font-size: var(--pcp-font-size-xl);
    font-weight: var(--pcp-font-weight-semibold);
    line-height: var(--pcp-line-height-tight);
    margin-bottom: var(--pcp-space-2);
}

h5, .h5 {
    font-size: var(--pcp-font-size-lg);
    font-weight: var(--pcp-font-weight-medium);
    line-height: var(--pcp-line-height-tight);
    margin-bottom: var(--pcp-space-2);
}

h6, .h6 {
    font-size: var(--pcp-font-size-base);
    font-weight: var(--pcp-font-weight-medium);
    line-height: var(--pcp-line-height-tight);
    margin-bottom: var(--pcp-space-1);
    text-transform: uppercase;
    letter-spacing: var(--pcp-letter-spacing-wide);
}

/* Body Text Styles */
p {
    margin-bottom: var(--pcp-space-2);
    line-height: var(--pcp-line-height-relaxed);
}

.text-lead {
    font-size: var(--pcp-font-size-lg);
    line-height: var(--pcp-line-height-relaxed);
    color: var(--pcp-text-muted);
}

.text-small {
    font-size: var(--pcp-font-size-sm);
}

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

/* Text Utilities */
.text-strong {
    color: var(--pcp-text-strong);
}

.text-muted {
    color: var(--pcp-text-muted);
}

.text-primary {
    color: var(--pcp-blue);
}

.text-accent {
    color: var(--pcp-orange);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Font Weight Utilities */
.font-regular {
    font-weight: var(--pcp-font-weight-regular);
}

.font-medium {
    font-weight: var(--pcp-font-weight-medium);
}

.font-semibold {
    font-weight: var(--pcp-font-weight-semibold);
}

.font-bold {
    font-weight: var(--pcp-font-weight-bold);
}

/* List Styles */
.list-disc {
    list-style-type: disc;
    padding-left: var(--pcp-space-3);
}

.list-disc li {
    margin-bottom: var(--pcp-space-1);
}

.list-decimal {
    list-style-type: decimal;
    padding-left: var(--pcp-space-3);
}

.list-decimal li {
    margin-bottom: var(--pcp-space-1);
}

/* Code Typography */
pre {
    background-color: var(--pcp-bg-2);
    border: 1px solid var(--pcp-border-light);
    border-radius: var(--pcp-radius);
    padding: var(--pcp-space-2);
    overflow-x: auto;
    margin-bottom: var(--pcp-space-3);
    font-size: var(--pcp-font-size-sm);
    line-height: var(--pcp-line-height-relaxed);
    box-shadow: var(--pcp-shadow-layered-sm);
    position: relative;
}

pre:hover {
    box-shadow: var(--pcp-shadow-layered-md);
}

code {
    background-color: var(--pcp-bg-2);
    padding: 2px 6px;
    border-radius: var(--pcp-radius);
    font-size: 0.9em;
    font-family: var(--pcp-font-mono);
    color: var(--pcp-text-strong);
}

pre code {
    background-color: transparent;
    padding: 0;
    font-size: inherit;
    display: block;
}

/* Code block with line numbers */
pre.line-numbers {
    padding-left: 3.5em;
    counter-reset: linenumber;
}

pre.line-numbers > code {
    position: relative;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: -3.5em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid var(--pcp-border-light);
    user-select: none;
}

.line-numbers-rows > span {
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: var(--pcp-text-muted);
    display: block;
    padding-right: 0.8em;
    text-align: right;
}

/* Syntax highlighting base */
.hljs {
    color: var(--pcp-text-strong);
    background: var(--pcp-bg-2);
}

.hljs-comment,
.hljs-quote {
    color: var(--pcp-text-muted);
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
    color: var(--pcp-blue);
    font-weight: var(--pcp-font-weight-medium);
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: var(--pcp-orange);
}

.hljs-string,
.hljs-doctag {
    color: var(--pcp-success);
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
    color: var(--pcp-blue);
    font-weight: var(--pcp-font-weight-semibold);
}

/* Inline code in headings */
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    font-size: 0.85em;
    background-color: var(--pcp-bg-1);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1, .h1 {
        font-size: var(--pcp-font-size-3xl);
    }
    
    h2, .h2 {
        font-size: var(--pcp-font-size-2xl);
    }
    
    h3, .h3 {
        font-size: var(--pcp-font-size-xl);
    }
    
    h4, .h4 {
        font-size: var(--pcp-font-size-lg);
    }
}

/* ============================================
   COMPONENT STYLES - BUTTONS
   ============================================ */

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--pcp-space-1) var(--pcp-space-2);
    border-radius: var(--pcp-radius);
    font-family: var(--pcp-font-body);
    font-size: var(--pcp-font-size-base);
    font-weight: var(--pcp-font-weight-medium);
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--pcp-transition-fast);
    white-space: nowrap;
    user-select: none;
}

/* Primary Button */
.btn-primary {
    background-color: var(--pcp-blue);
    color: white;
    box-shadow: var(--pcp-shadow-blue-sm);
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: var(--pcp-shadow-blue-md);
    opacity: 0.9;
    text-decoration: none;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.8;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--pcp-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--pcp-bg-0);
    color: var(--pcp-text-strong);
    border-color: var(--pcp-border-light);
    box-shadow: var(--pcp-shadow-layered-sm);
}

.btn-secondary:hover {
    background-color: var(--pcp-bg-1);
    box-shadow: var(--pcp-shadow-layered-md);
    transform: scale(1.03);
    text-decoration: none;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--pcp-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Ghost Button */
.btn-ghost {
    background-color: transparent;
    color: var(--pcp-blue);
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--pcp-bg-1);
    transform: scale(1.03);
    text-decoration: none;
}

.btn-ghost:active {
    transform: scale(0.98);
    background-color: var(--pcp-bg-2);
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: var(--pcp-font-size-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--pcp-font-size-lg);
}

/* Button States */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Button with Icon */
.btn-icon {
    gap: var(--pcp-space-1);
}

.btn-icon svg {
    width: 1em;
    height: 1em;
}

/* Full Width Button */
.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================
   COMPONENT STYLES - CARDS
   ============================================ */

/* Base Card */
.card {
    background-color: var(--pcp-bg-0);
    border: 1px solid var(--pcp-border-light);
    border-radius: var(--pcp-radius);
    padding: var(--pcp-space-3);
    box-shadow: var(--pcp-shadow-layered-sm);
    transition: all var(--pcp-transition-base);
}

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

/* Card Header */
.card-header {
    margin-bottom: var(--pcp-space-2);
    padding-bottom: var(--pcp-space-2);
    border-bottom: 1px solid var(--pcp-border-light);
}

.card-title {
    font-size: var(--pcp-font-size-xl);
    font-weight: var(--pcp-font-weight-semibold);
    color: var(--pcp-text-strong);
    margin: 0;
}

.card-subtitle {
    font-size: var(--pcp-font-size-sm);
    color: var(--pcp-text-muted);
    margin-top: var(--pcp-space-1);
}

/* Card Body */
.card-body {
    color: var(--pcp-text-strong);
}

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

/* Card Footer */
.card-footer {
    margin-top: var(--pcp-space-2);
    padding-top: var(--pcp-space-2);
    border-top: 1px solid var(--pcp-border-light);
}

/* Card Variants */
.card-elevated {
    box-shadow: var(--pcp-shadow-layered-md);
}

.card-elevated:hover {
    box-shadow: var(--pcp-shadow-layered-lg);
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--pcp-border-default);
}

.card-flat:hover {
    box-shadow: var(--pcp-shadow-sm);
}

/* Clickable Card */
.card-clickable {
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.card-clickable:hover {
    box-shadow: var(--pcp-shadow-layered-md);
    transform: translateY(-2px) scale(1.01);
}

/* Blog Post Card */
.post-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background-color: var(--pcp-bg-0);
    border: 1px solid var(--pcp-border-light);
    border-radius: var(--pcp-radius);
    padding: var(--pcp-space-3);
    box-shadow: var(--pcp-shadow-layered-sm);
    transition: all var(--pcp-transition-base);
    margin-bottom: var(--pcp-space-3);
}

.post-card:hover {
    box-shadow: var(--pcp-shadow-layered-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.post-card-title {
    font-size: var(--pcp-font-size-2xl);
    font-weight: var(--pcp-font-weight-semibold);
    color: var(--pcp-text-strong);
    margin-bottom: var(--pcp-space-1);
    line-height: var(--pcp-line-height-tight);
}

.post-card-meta {
    display: flex;
    gap: var(--pcp-space-2);
    flex-wrap: wrap;
    margin-bottom: var(--pcp-space-2);
    font-size: var(--pcp-font-size-sm);
    color: var(--pcp-text-muted);
}

.post-card-excerpt {
    color: var(--pcp-text-strong);
    line-height: var(--pcp-line-height-relaxed);
    margin-bottom: var(--pcp-space-2);
}

.post-card-tags {
    display: flex;
    gap: var(--pcp-space-1);
    flex-wrap: wrap;
}

/* Card Grid */
.card-grid {
    display: grid;
    gap: var(--pcp-space-3);
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   COMPONENT STYLES - BADGES & TAGS
   ============================================ */

/* Base Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--pcp-radius);
    font-size: var(--pcp-font-size-xs);
    font-weight: var(--pcp-font-weight-semibold);
    font-family: var(--pcp-font-mono);
    background-color: var(--pcp-bg-2);
    color: var(--pcp-text-muted);
    box-shadow: var(--pcp-shadow-layered-sm);
    transition: all var(--pcp-transition-fast);
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.badge:hover {
    transform: scale(1.03);
    box-shadow: var(--pcp-shadow-layered-md);
}

/* Badge Variants */
.badge-primary {
    background-color: var(--pcp-blue);
    color: white;
}

.badge-accent {
    background-color: var(--pcp-orange);
    color: white;
}

.badge-success {
    background-color: var(--pcp-success);
    color: white;
}

.badge-warning {
    background-color: var(--pcp-warning);
    color: white;
}

.badge-error {
    background-color: var(--pcp-error);
    color: white;
}

/* Tag Component (for blog posts) */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--pcp-radius);
    font-size: var(--pcp-font-size-sm);
    font-weight: var(--pcp-font-weight-medium);
    background-color: var(--pcp-bg-1);
    color: var(--pcp-text-muted);
    border: 1px solid var(--pcp-border-light);
    text-decoration: none;
    transition: all var(--pcp-transition-fast);
}

.tag:hover {
    background-color: var(--pcp-bg-2);
    color: var(--pcp-text-strong);
    transform: scale(1.03);
    text-decoration: none;
    box-shadow: var(--pcp-shadow-sm);
}

.tag:active {
    transform: scale(0.98);
}

/* Tag with count */
.tag-count {
    margin-left: var(--pcp-space-1);
    padding: 2px 6px;
    background-color: var(--pcp-bg-2);
    border-radius: var(--pcp-radius);
    font-size: var(--pcp-font-size-xs);
    font-weight: var(--pcp-font-weight-semibold);
}

/* Tag List */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pcp-space-1);
}

/* Post Meta Badge */
.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: var(--pcp-font-size-xs);
    color: var(--pcp-text-muted);
    background-color: var(--pcp-bg-1);
    border-radius: var(--pcp-radius);
}

.meta-badge svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* Reading Time Badge */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--pcp-font-size-sm);
    color: var(--pcp-text-muted);
}

.reading-time::before {
    content: "•";
    margin: 0 4px;
}

/* ============================================
   COMPONENT STYLES - FORM INPUTS
   ============================================ */

/* Base Input Field */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: var(--pcp-space-1) 12px;
    border-radius: var(--pcp-radius);
    background-color: var(--pcp-bg-0);
    border: 1px solid var(--pcp-border-light);
    color: var(--pcp-text-strong);
    font-size: var(--pcp-font-size-base);
    line-height: 1.5;
    caret-color: var(--pcp-orange); /* Signature orange caret */
    transition: all var(--pcp-transition-fast);
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    border-color: var(--pcp-blue);
    outline: none;
    box-shadow: 0 0 0 1px var(--pcp-blue);
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--pcp-text-muted);
    opacity: 0.7;
}

/* Input with Icon */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--pcp-text-muted);
    pointer-events: none;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.input-with-icon {
    padding-left: 40px;
}

/* Textarea specific */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select specific */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23525252' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Checkbox and Radio */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: var(--pcp-space-1);
    accent-color: var(--pcp-blue);
}

/* Form Label */
.label,
label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--pcp-font-size-sm);
    font-weight: var(--pcp-font-weight-medium);
    color: var(--pcp-text-strong);
}

/* Form Helper Text */
.form-helper {
    margin-top: 6px;
    font-size: var(--pcp-font-size-xs);
    color: var(--pcp-text-muted);
}

/* Form Error State */
.input-error,
.input.error {
    border-color: var(--pcp-error);
}

.input-error:focus,
.input.error:focus {
    box-shadow: 0 0 0 1px var(--pcp-error);
}

.form-error {
    margin-top: 6px;
    font-size: var(--pcp-font-size-xs);
    color: var(--pcp-error);
}

/* Form Success State */
.input-success,
.input.success {
    border-color: var(--pcp-success);
}

.input-success:focus,
.input.success:focus {
    box-shadow: 0 0 0 1px var(--pcp-success);
}

/* Form Group */
.form-group {
    margin-bottom: var(--pcp-space-3);
}

/* Inline Form */
.form-inline {
    display: flex;
    gap: var(--pcp-space-2);
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ============================================
   COMPONENT STYLES - NAVIGATION
   ============================================ */

/* Navigation Container */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--pcp-space-2) 0;
    border-bottom: 1px solid var(--pcp-border-light);
    background-color: var(--pcp-bg-0);
}

/* Nav Brand/Logo */
.nav-brand {
    font-size: var(--pcp-font-size-xl);
    font-weight: var(--pcp-font-weight-bold);
    color: var(--pcp-text-strong);
    text-decoration: none;
    transition: all var(--pcp-transition-fast);
}

.nav-brand:hover {
    color: var(--pcp-blue);
    transform: scale(1.03);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    gap: var(--pcp-space-3);
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nav Links */
.nav-link {
    color: var(--pcp-text-muted);
    text-decoration: none;
    font-weight: var(--pcp-font-weight-medium);
    transition: all var(--pcp-transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--pcp-text-strong);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--pcp-blue);
}

/* Nav Link Underline Animation */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--pcp-orange);
    transition: width var(--pcp-transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--pcp-text-strong);
    transition: all var(--pcp-transition-fast);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: var(--pcp-bg-0);
        flex-direction: column;
        padding: var(--pcp-space-3);
        border-bottom: 1px solid var(--pcp-border-light);
        box-shadow: var(--pcp-shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        transition: all var(--pcp-transition-base);
        z-index: var(--pcp-z-dropdown);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   COMPONENT STYLES - FOOTER
   ============================================ */

/* Footer Container */
.footer {
    margin-top: var(--pcp-space-10);
    padding: var(--pcp-space-6) 0;
    border-top: 1px solid var(--pcp-border-light);
    background-color: var(--pcp-bg-1);
}

/* Footer Content */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--pcp-space-4);
    margin-bottom: var(--pcp-space-4);
}

/* Footer Section */
.footer-section {
    display: flex;
    flex-direction: column;
    gap: var(--pcp-space-2);
}

.footer-title {
    font-size: var(--pcp-font-size-lg);
    font-weight: var(--pcp-font-weight-semibold);
    color: var(--pcp-text-strong);
    margin-bottom: var(--pcp-space-1);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--pcp-space-1);
}

.footer-link {
    color: var(--pcp-text-muted);
    text-decoration: none;
    transition: all var(--pcp-transition-fast);
}

.footer-link:hover {
    color: var(--pcp-blue);
    transform: translateX(4px);
}

/* Footer Bottom */
.footer-bottom {
    padding-top: var(--pcp-space-3);
    border-top: 1px solid var(--pcp-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--pcp-space-2);
}

.footer-copyright {
    color: var(--pcp-text-muted);
    font-size: var(--pcp-font-size-sm);
}

/* Social Links */
.social-links {
    display: flex;
    gap: var(--pcp-space-2);
}

.social-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--pcp-bg-2);
    border-radius: var(--pcp-radius);
    color: var(--pcp-text-muted);
    text-decoration: none;
    transition: all var(--pcp-transition-fast);
}

.social-link:hover {
    background-color: var(--pcp-blue);
    color: white;
    transform: scale(1.1);
}

/* ============================================
   COMPONENT STYLES - LINKS & INTERACTIVE
   ============================================ */

/* Enhanced Link Styles */
.link {
    color: var(--pcp-blue);
    text-decoration: none;
    position: relative;
    transition: all var(--pcp-transition-fast);
}

.link:not(.nav-link):not(.link-animated):hover {
    color: var(--pcp-blue);
    text-decoration: none;
}

/* Link with underline animation */
.link-animated {
    position: relative;
    color: var(--pcp-blue);
    text-decoration: none;
    padding-bottom: 2px;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--pcp-orange);
    transition: width var(--pcp-transition-fast);
}

.link-animated:hover::after {
    width: 100%;
}

/* External link indicator */
.link-external::after {
    content: '↗';
    margin-left: 4px;
    font-size: 0.85em;
    vertical-align: super;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: var(--pcp-space-4);
    right: var(--pcp-space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--pcp-bg-0);
    border: 1px solid var(--pcp-border-light);
    border-radius: var(--pcp-radius);
    box-shadow: var(--pcp-shadow-layered-md);
    color: var(--pcp-text-muted);
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--pcp-transition-base);
    z-index: var(--pcp-z-sticky);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--pcp-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--pcp-shadow-layered-lg);
}

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

/* Main Container */
.pcp-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--pcp-bg-0);
}

/* Content Container */
.container {
    width: 100%;
    max-width: var(--pcp-container-xl);
    margin: 0 auto;
    padding: 0 var(--pcp-space-3);
}

.container-sm {
    max-width: var(--pcp-container-sm);
}

.container-md {
    max-width: var(--pcp-container-md);
}

.container-lg {
    max-width: var(--pcp-container-lg);
}

.container-2xl {
    max-width: var(--pcp-container-2xl);
}

/* Main Content Area */
.pcp-main {
    flex: 1;
    width: 100%;
    padding: var(--pcp-space-6) 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--pcp-space-3);
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.gap-1 {
    gap: var(--pcp-space-1);
}

.gap-2 {
    gap: var(--pcp-space-2);
}

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

.gap-4 {
    gap: var(--pcp-space-4);
}

/* Spacing Utilities */
.mt-1 { margin-top: var(--pcp-space-1); }
.mt-2 { margin-top: var(--pcp-space-2); }
.mt-3 { margin-top: var(--pcp-space-3); }
.mt-4 { margin-top: var(--pcp-space-4); }
.mt-5 { margin-top: var(--pcp-space-5); }
.mt-6 { margin-top: var(--pcp-space-6); }

.mb-1 { margin-bottom: var(--pcp-space-1); }
.mb-2 { margin-bottom: var(--pcp-space-2); }
.mb-3 { margin-bottom: var(--pcp-space-3); }
.mb-4 { margin-bottom: var(--pcp-space-4); }
.mb-5 { margin-bottom: var(--pcp-space-5); }
.mb-6 { margin-bottom: var(--pcp-space-6); }

.pt-1 { padding-top: var(--pcp-space-1); }
.pt-2 { padding-top: var(--pcp-space-2); }
.pt-3 { padding-top: var(--pcp-space-3); }
.pt-4 { padding-top: var(--pcp-space-4); }
.pt-5 { padding-top: var(--pcp-space-5); }
.pt-6 { padding-top: var(--pcp-space-6); }

.pb-1 { padding-bottom: var(--pcp-space-1); }
.pb-2 { padding-bottom: var(--pcp-space-2); }
.pb-3 { padding-bottom: var(--pcp-space-3); }
.pb-4 { padding-bottom: var(--pcp-space-4); }
.pb-5 { padding-bottom: var(--pcp-space-5); }
.pb-6 { padding-bottom: var(--pcp-space-6); }
