/* Anthropic-inspired Theme - Minimal, refined, warm */
:root {
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Core colors from Anthropic */
    --primary-color: #d97757; /* Terracotta/rust accent */
    --primary-hover: #c46a4a;
    --primary-light: rgba(217, 119, 87, 0.1);
    --foreground: #131314; /* Near-black text */
    --background: #faf9f0; /* Cream/off-white */
    --text-muted: #87867f; /* Slate gray */
    --text-secondary: #5a5955;
    --card-bg: #ffffff;
    --border-color: #e9e8e4;
    --selection-bg: rgba(204, 120, 92, 0.5);
    --success-color: #22c55e;
    --error-color: #ef4444;

    /* Spacing & sizing */
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);

    /* Site margins */
    --site-margin: clamp(1.5rem, 5vw, 5rem);
    --content-width: 1100px;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #e8956f;
    --primary-hover: #f0a883;
    --primary-light: rgba(232, 149, 111, 0.15);
    --foreground: #faf9f0;
    --background: #131314;
    --text-muted: #a09a94;
    --text-secondary: #87867f;
    --card-bg: #1e1e1f;
    --border-color: #2e2e30;
    --selection-bg: rgba(232, 149, 111, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #e8956f;
        --primary-hover: #f0a883;
        --foreground: #faf9f0;
        --background: #131314;
        --text-muted: #a09a94;
        --text-secondary: #87867f;
        --card-bg: #1e1e1f;
        --border-color: #2e2e30;
        --selection-bg: rgba(232, 149, 111, 0.4);
    }
}

/* Selection styling */
::selection {
    background: var(--selection-bg);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    background-color: var(--background);
    color: var(--foreground);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem var(--site-margin);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: var(--background);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--content-width);
    margin: 0 auto;
}

.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.01em;
    text-decoration: none;
}

.logo:hover {
    color: var(--foreground);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 450;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--foreground);
}

/* Main content */
main {
    flex: 1;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) var(--site-margin);
    width: 100%;
}

/* Typography - Responsive scaling */
h1, h2, h3, h4 {
    color: var(--foreground);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    margin-bottom: 1rem;
}

h3 {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Focus states - Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border-color);
}

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

/* Cards */
.card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.card h2 {
    margin-bottom: 0.75rem;
}

.card p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.card .tags {
    margin-bottom: 1.25rem;
}

.card .btn {
    margin-top: 1.25rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: clamp(3rem, 8vw, 6rem) 2rem;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--foreground);
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    font-weight: 600;
}

.hero-sub {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Resume Styles */
.resume-container {
    background: var(--card-bg);
    padding: clamp(2rem, 4vw, 3.5rem);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.resume-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.resume-header h1 {
    color: var(--foreground);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 0.5rem;
}

.resume-header h2 {
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Language flag switch */
.lang-flag {
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.lang-flag:hover {
    opacity: 1;
    transform: scale(1.1);
}

.contact-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.summary {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.7;
}

.resume-section {
    margin-bottom: 2.5rem;
}

.resume-section h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8125rem;
    font-weight: 600;
}

.job {
    margin-bottom: 2rem;
}

.job h4 {
    font-size: 1.0625rem;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.job .date {
    float: right;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.job p em {
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.75rem;
    font-style: normal;
}

.job ul {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.job li {
    margin-bottom: 0.5rem;
}

.tech-stack {
    background: var(--background);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.skills-list {
    list-style: none;
}

.skills-list li {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.skills-list strong {
    color: var(--primary-color);
    display: inline-block;
    min-width: 120px;
}

/* Blog Layout with Sidebar */
.blog-layout {
    width: 100%;
}

.blog-page-title {
    margin-bottom: 1.5rem;
}

.blog-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* Blog Sidebar */
.blog-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.blog-sidebar h3 {
    color: var(--primary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-link-btn {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    text-align: left;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-link-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.archive-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.archive-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-color);
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-date {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.archive-title {
    display: block;
    font-size: 0.875rem;
    color: var(--foreground);
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.archive-title:hover {
    color: var(--primary-color);
}

.archive-tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag-small {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    background: var(--background);
    border-radius: 20px;
    color: var(--text-muted);
}

/* Blog Main Content */
.blog-main {
    flex: 1;
    min-width: 0;
}

/* Featured Post */
.featured-post {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    transition: all 0.2s ease;
}

.featured-post:hover {
    box-shadow: var(--shadow-hover);
}

.featured-label {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.featured-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-title a {
    color: var(--foreground);
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-title a:hover {
    color: var(--primary-color);
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.featured-date {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.featured-reading-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.featured-summary {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.featured-tags {
    margin-bottom: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.read-more-btn:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Blog List (legacy) */
.blog-list h1 {
    margin-bottom: 2rem;
}

.blog-list ul {
    list-style: none;
}

.blog-item {
    background: var(--card-bg);
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.blog-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.blog-item .date {
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 500;
}

.blog-item .reading-time {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-left: 1rem;
}

.blog-item h2 {
    margin: 0.625rem 0;
    font-size: 1.25rem;
}

.blog-item h2 a {
    color: var(--foreground);
    text-decoration: none;
}

.blog-item h2 a:hover {
    color: var(--primary-color);
}

.blog-item p {
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Tags */
.tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    background: var(--background);
    color: var(--text-muted);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.tag:hover, .tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tag filter */
.tag-filter {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tag-filter span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Search */
.search-section h1 {
    margin-bottom: 1.5rem;
}

.search-link {
    margin-bottom: 2rem;
}

.search-link a {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.search-link a:hover {
    color: var(--primary-color);
}

.search-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.search-form input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--foreground);
    transition: border-color 0.2s ease;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-results-count {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
    margin-top: 3rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.pagination span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Blog Post */
.blog-post {
    background: var(--card-bg);
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

/* Blog Post with Hero Image */
.blog-post.has-hero {
    padding-top: 0;
    overflow: hidden;
}

.post-hero {
    position: relative;
    margin: calc(-1 * clamp(2rem, 5vw, 3.5rem));
    margin-bottom: 2rem;
    height: 320px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.post-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.75) 100%
    );
}

.post-hero-content {
    position: relative;
    z-index: 1;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    width: 100%;
}

.post-hero-content h1 {
    color: #ffffff;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.post-hero .post-meta {
    margin-bottom: 0.75rem;
}

.post-hero .post-meta time,
.post-hero .post-meta .updated-date,
.post-hero .post-meta .reading-time {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.post-hero .tags {
    margin-top: 0.75rem;
}

.tag-light {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.tag-light:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .post-hero {
        height: 260px;
        margin: -1.5rem;
        margin-bottom: 2rem;
    }

    .post-hero-content h1 {
        font-size: 1.375rem;
    }
}

@media (min-width: 769px) {
    .post-hero {
        height: 360px;
    }
}

.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    /* Override inherited header styles */
    position: static;
    z-index: auto;
    backdrop-filter: none;
    background: transparent;
}

.post-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-meta time {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.post-meta .reading-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.post-meta .updated-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.content {
    line-height: 1.8;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    color: var(--text-secondary);
}

.content h2, .content h3 {
    color: var(--foreground);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 100px; /* Offset for sticky header when scrolling to anchors */
}

.content p {
    margin-bottom: 1.5rem;
}

.content ul, .content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content pre {
    background: #1e1e1f;
    color: #faf9f0;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.75rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
    border: 1px solid var(--border-color);
}

/* Prism line numbers */
.content pre.line-numbers {
    padding-left: 0.5rem;
    counter-reset: linenumber;
}

.content pre .line-numbers-rows {
    border-right: 1px solid #3a3a3c;
    padding-right: 0.3rem;
    margin-right: 0.5rem;
    min-width: 1.5rem;
}

.content pre .line-numbers-rows > span:before {
    color: #6a6a6c;
}

.content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.content p code {
    background: var(--background);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.75rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.content img {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin: 1.75rem 0;
}

.content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.content a:hover {
    color: var(--primary-hover);
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Contact Page */
.contact-page {
    max-width: 640px;
    margin: 0 auto;
}

.contact-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-subtitle {
    color: var(--text-muted);
    font-size: 1.0625rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

.contact-info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-info-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: border-color 0.2s ease;
}

.contact-info-card:hover {
    border-color: var(--primary-color);
}

.contact-info-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.contact-info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.contact-info-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--foreground);
}

a.contact-info-value:hover {
    color: var(--primary-color);
}

@media (max-width: 480px) {
    .contact-info-cards {
        grid-template-columns: 1fr;
    }
}

/* Contact Form */
.contact-form-section {
    background: var(--card-bg);
    padding: clamp(2rem, 4vw, 3rem);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.success-message {
    text-align: center;
    padding: 2.5rem 2rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.4s ease-out;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--success-color);
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.success-message h2 {
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.9375rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--background);
    color: var(--foreground);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--card-bg);
}

.form-group input:invalid:not(:placeholder-shown):not(:focus),
.form-group textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--error-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0.5rem;
    gap: 1rem;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.char-counter.over-limit {
    color: var(--error-color);
    font-weight: 500;
}

.form-error {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--error-color);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.form-error svg {
    flex-shrink: 0;
}

.contact-submit {
    width: 100%;
    margin-top: 0.5rem;
    min-height: 48px;
}

.contact-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.contact-submit:disabled::after {
    display: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* About section */
.about {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 0.875rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--background);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem var(--site-margin);
    margin-top: auto;
}

footer p {
    margin: 0;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {
    .blog-container {
        flex-direction: column-reverse;
    }

    .blog-sidebar {
        width: 100%;
        position: static;
        margin-top: 2rem;
    }

    .archive-list {
        max-height: none;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 0.75rem;
    }

    .archive-item {
        padding: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        background: var(--background);
    }

    .featured-post {
        padding: 1.5rem;
    }

    .featured-title {
        font-size: 1.375rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem var(--site-margin);
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero {
        padding: 2.5rem 1.5rem;
    }

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

    .nav-links {
        gap: 1.25rem;
    }

    .nav-links a {
        font-size: 0.875rem;
    }

    .blog-post {
        padding: 1.5rem;
    }

    .resume-container {
        padding: 1.5rem;
    }

    .archive-list {
        grid-template-columns: 1fr;
    }

    .featured-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .job .date {
        float: none;
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--foreground);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 0;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 100;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
        margin-top: 1rem;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
    }

    .nav-links .theme-toggle {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-links {
        width: 100%;
    }

    .logo {
        font-size: 1rem;
    }

    main {
        padding: 1.5rem 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.4s ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Error Pages */
.error-page {
    text-align: center;
    padding: clamp(3rem, 10vw, 6rem) 2rem;
}

.error-code {
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.error-page h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    box-sizing: border-box;
    overflow: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    flex-shrink: 0;
}

/* Code Block Copy Button */
.code-block-wrapper {
    position: relative;
    margin: 1.75rem 0;
}

.content .code-block-wrapper pre {
    margin: 0;
}

.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 4px;
    color: #888;
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.code-block-wrapper:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #aaa;
}

.copy-button.copied {
    color: #22c55e;
}

/* Mobile Menu Performance */
.nav-links {
    will-change: transform;
}

.mobile-overlay {
    will-change: opacity;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Print Styles */
@media print {
    header,
    footer,
    .back-to-top,
    .copy-button,
    .mobile-menu-toggle,
    .mobile-overlay,
    .back-link,
    .tags,
    .toc-sidebar,
    .reading-progress,
    .share-buttons,
    .search-modal {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }

    main {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .blog-post {
        background: none;
        border: none;
        padding: 0;
        box-shadow: none;
    }

    .content {
        color: black;
    }

    .content a {
        color: black;
        text-decoration: underline;
    }

    .content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .content pre {
        background: #f5f5f5;
        border: 1px solid #ddd;
        color: black;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    .content code {
        background: #f5f5f5;
        color: black;
    }

    .post-header {
        border-bottom: 2px solid black;
    }

    .post-meta time {
        color: #666;
    }

    h1, h2, h3, h4 {
        color: black;
        page-break-after: avoid;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    @page {
        margin: 2cm;
    }
}

/* ============================================
   UI ENHANCEMENTS - Alpine.js Powered Features
   ============================================ */

/* Skip to Content Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    z-index: 1001;
    text-decoration: none;
    font-weight: 500;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* Enhanced Focus Indicators */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

.btn:focus-visible {
    outline-offset: 4px;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.card:focus-within {
    box-shadow: 0 0 0 3px var(--primary-color);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    width: 0%;
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs li[aria-current="page"] {
    color: var(--foreground);
    font-weight: 500;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: fixed;
    right: max(2rem, calc((100vw - var(--content-width)) / 2 - 280px));
    top: 120px;
    width: 220px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    z-index: 50;
}

/* Hide TOC on mobile/tablet - show on desktop (1024px+) */
@media (max-width: 1023px) {
    .toc-sidebar {
        display: none !important;
    }
}

.toc-sidebar h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-h3 {
    padding-left: 1rem;
}

.toc-link {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.toc-link:hover,
.toc-link.active {
    color: var(--primary-color);
}

.toc-link.active {
    font-weight: 500;
}

/* Enhanced Blockquotes */
.content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    background: var(--background);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    position: relative;
    font-style: normal;
}

.content blockquote::before {
    content: '"';
    position: absolute;
    top: -0.25rem;
    left: 0.75rem;
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

.content blockquote p:last-child {
    margin-bottom: 0;
}

.content blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: normal;
}

.content blockquote cite::before {
    content: '— ';
}

/* Enhanced Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.9375rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.content th,
.content td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.content th {
    background: var(--background);
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content tr:last-child td {
    border-bottom: none;
}

.content tr:hover td {
    background: var(--background);
}

@media (max-width: 640px) {
    .content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Search Modal */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
}

.search-modal {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 560px;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 201;
    overflow: hidden;
}

.search-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.125rem;
    background: transparent;
    color: var(--foreground);
    font-family: var(--font-sans);
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background 0.15s ease;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover,
.search-result.selected {
    background: var(--background);
}

.search-result-title {
    display: block;
    color: var(--foreground);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.search-result-title mark {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0 0.125rem;
    border-radius: 2px;
}

.search-result-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.search-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-trigger:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.search-trigger kbd {
    background: var(--background);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
}

/* Image Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Content images clickable */
.content img {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.content img:hover {
    transform: scale(1.01);
}

/* Social Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.share-buttons > span {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

.share-btn.copied {
    border-color: var(--success-color);
    color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-posts h3 {
    font-size: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.related-posts ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-posts li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.related-posts li:last-child {
    border-bottom: none;
}

.related-posts a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
}

.related-posts a:hover {
    color: var(--primary-color);
}

.related-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Resume Timeline */
.job {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
}

.job::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.job::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1.5rem;
    bottom: -1rem;
    width: 2px;
    background: var(--border-color);
}

.job:last-child::after {
    display: none;
}

/* Print Button */
.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeInUp 0.5s ease-out;
}

/* Staggered card animations */
.card,
.archive-item,
.blog-item {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.card:nth-child(1), .archive-item:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2), .archive-item:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3), .archive-item:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4), .archive-item:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5), .archive-item:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6), .archive-item:nth-child(6) { animation-delay: 0.3s; }

/* Enhanced Card Hover */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Button Hover Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Theme Toggle Animation */
.theme-toggle {
    transition: transform 0.3s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

/* Copy Button Enhancement */
.copy-button.copied::before {
    content: '✓ ';
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Loading Bar Animation */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-hover) 50%, var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    z-index: 1001;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Footnotes */
.content .footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.content .footnotes {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.content .footnotes ol {
    padding-left: 1.5rem;
}

.content .footnotes li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.content .footnote-backref {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 0.25rem;
}

/* Alpine.js Transitions */
[x-cloak] {
    display: none !important;
}

/* Smooth transitions for Alpine.js */
.alpine-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.alpine-enter-active {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.alpine-leave-active {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.alpine-leave-to {
    opacity: 0;
    transform: translateY(-10px);
}
