/* CSS Variables for easy customization */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #ecf0f1;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Code block colors */
    --code-bg: #f8f9fa;
    --code-text: #e74c3c;
    --code-border: #ecf0f1;
    --pre-bg: #f8f9fa;
    --pre-text: #2c3e50;
    --pre-border: #ecf0f1;
    
    /* Table colors */
    --table-bg: #ffffff;
    --table-header-bg: #2c3e50;
    --table-header-text: #ffffff;
    --table-border: #ecf0f1;
    --table-stripe: #f8f9fa;
    --table-hover: rgba(52, 152, 219, 0.05);
    
    /* Footer colors */
    --footer-bg: #2c3e50;
    --footer-text: #ffffff;
    --footer-text-muted: rgba(255, 255, 255, 0.8);
    --footer-border: rgba(255, 255, 255, 0.1);
    
    /* Hero gradient colors */
    --hero-bg-start: #0f0f23;
    --hero-bg-middle: #1a1a3a;
    --hero-bg-end: #2d2d5a;
    --hero-text: #ffffff;
    --hero-text-muted: rgba(255, 255, 255, 0.9);
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #64b5f6;
    --secondary-color: #81c784;
    --accent-color: #ff8a65;
    --text-color: #e0e0e0;
    --text-muted: #b0b0b0;
    --bg-color: #121212;
    --bg-secondary: #1e1e1e;
    --border-color: #2a2a2a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4);
    
    /* Code block colors for dark mode */
    --code-bg: #2a2a2a;
    --code-text: #ff8a65;
    --code-border: #404040;
    --pre-bg: #1e1e1e;
    --pre-text: #e0e0e0;
    --pre-border: #404040;
    
    /* Table colors for dark mode */
    --table-bg: #1e1e1e;
    --table-header-bg: #64b5f6;
    --table-header-text: #121212;
    --table-border: #404040;
    --table-stripe: #2a2a2a;
    --table-hover: rgba(100, 181, 246, 0.1);
    
    /* Footer colors for dark mode */
    --footer-bg: #0a0a0a;
    --footer-text: #e0e0e0;
    --footer-text-muted: rgba(224, 224, 224, 0.8);
    --footer-border: rgba(224, 224, 224, 0.1);
    
    /* Hero gradient colors for dark mode */
    --hero-bg-start: #0a0a15;
    --hero-bg-middle: #12122a;
    --hero-bg-end: #1a1a40;
    --hero-text: #ffffff;
    --hero-text-muted: rgba(255, 255, 255, 0.9);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

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

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Header and Navigation */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

[data-theme="dark"] .site-header {
    background: rgba(18, 18, 18, 0.95);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    font-size: 1.5rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

.theme-toggle .sun-icon {
    display: none;
    color: #f39c12;
}

.theme-toggle .moon-icon {
    display: block;
    color: var(--primary-color);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

.site-header.scrolled {
    box-shadow: var(--shadow);
}

.navbar {
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    text-align: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.nav-items {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none !important;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Dropdown styles */
.nav-dropdown {
    position: relative;
}

.nav-more-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
}

.nav-more-btn:hover,
.nav-dropdown.show .nav-more-btn {
    background-color: var(--secondary-color);
    color: white;
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.nav-dropdown.show .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin: 0.125rem 0.5rem;
}

.nav-dropdown-content .nav-link:hover {
    background-color: var(--secondary-color);
    color: white;
}

.nav-dropdown-content .nav-link.active {
    background-color: var(--secondary-color);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 3px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* Main content */
.main-content {
    margin-top: 90px;
    min-height: calc(100vh - 90px);
}

/* Add top margin for all pages except home */
body:not(.home) .main-content {
    margin-top: 100px;
    padding-top: 1rem;
}

/* Ensure home page keeps original spacing */
body.home .main-content {
    margin-top: 90px;
    padding-top: 0;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--hero-bg-start) 0%, var(--hero-bg-middle) 50%, var(--hero-bg-end) 100%);
    color: var(--hero-text);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(120, 100, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 100, 150, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(100, 255, 150, 0.1) 0%, transparent 50%);
    animation: gradientShift 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='40' y='45' text-anchor='middle' fill='%23ffffff' fill-opacity='0.04' font-size='20' font-family='serif'%3E∑%3C/text%3E%3C/svg%3E") 0 0,
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='50' y='55' text-anchor='middle' fill='%23ffffff' fill-opacity='0.035' font-size='24' font-family='serif'%3E∫%3C/text%3E%3C/svg%3E") 200px 100px,
        url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='45' y='50' text-anchor='middle' fill='%23ffffff' fill-opacity='0.045' font-size='22' font-family='serif'%3Eπ%3C/text%3E%3C/svg%3E") 400px 50px,
        url("data:image/svg+xml,%3Csvg width='85' height='85' viewBox='0 0 85 85' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='42.5' y='48' text-anchor='middle' fill='%23ffffff' fill-opacity='0.04' font-size='21' font-family='serif'%3E∞%3C/text%3E%3C/svg%3E") 600px 150px,
        url("data:image/svg+xml,%3Csvg width='95' height='95' viewBox='0 0 95 95' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='47.5' y='52' text-anchor='middle' fill='%23ffffff' fill-opacity='0.035' font-size='23' font-family='serif'%3E∂%3C/text%3E%3C/svg%3E") 800px 80px,
        url("data:image/svg+xml,%3Csvg width='75' height='75' viewBox='0 0 75 75' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='37.5' y='43' text-anchor='middle' fill='%23ffffff' fill-opacity='0.04' font-size='19' font-family='serif'%3Eα%3C/text%3E%3C/svg%3E") 100px 200px,
        url("data:image/svg+xml,%3Csvg width='110' height='110' viewBox='0 0 110 110' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='55' y='60' text-anchor='middle' fill='%23ffffff' fill-opacity='0.045' font-size='25' font-family='serif'%3EΔ%3C/text%3E%3C/svg%3E") 300px 250px,
        url("data:image/svg+xml,%3Csvg width='88' height='88' viewBox='0 0 88 88' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='44' y='49' text-anchor='middle' fill='%23ffffff' fill-opacity='0.035' font-size='21' font-family='serif'%3Eλ%3C/text%3E%3C/svg%3E") 500px 300px,
        url("data:image/svg+xml,%3Csvg width='82' height='82' viewBox='0 0 82 82' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='41' y='46' text-anchor='middle' fill='%23ffffff' fill-opacity='0.04' font-size='20' font-family='serif'%3Eφ%3C/text%3E%3C/svg%3E") 700px 220px;
    animation: mathFloatSlow 60s linear infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes mathFloatSlow {
    0% { 
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
    50% { 
        transform: translateY(-5px) translateX(3px);
        opacity: 0.8;
    }
    100% { 
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    animation: fadeInUp 1s ease-out;
}

.hero-text {
    order: 2;
    text-align: left;
}

.hero-image {
    order: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Add extra curly bubbles for more organic look */
.hero-image::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    opacity: 0;
    animation: extraBubble1 3s ease-in-out infinite 3s;
}

.hero-image::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 35%;
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    opacity: 0;
    animation: extraBubble2 3s ease-in-out infinite 3.5s;
}

@keyframes extraBubble1 {
    0%, 80%, 100% {
        opacity: 0;
        transform: translateY(0px) scale(1);
    }
    20%, 60% {
        opacity: 0.6;
        transform: translateY(-5px) scale(1.2);
    }
}

@keyframes extraBubble2 {
    0%, 70%, 100% {
        opacity: 0;
        transform: translateY(0px) scale(1);
    }
    30%, 50% {
        opacity: 0.4;
        transform: translateY(-3px) scale(1.1);
    }
}

.status-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(124, 100, 255, 0.4);
    animation: bubbleGlow 2s ease-in-out infinite, fadeInBubble 1s ease-out 2.7s forwards;
    opacity: 0;
    backdrop-filter: blur(10px);
    transform: translateY(10px) scale(0.8);
    border: 1px solid rgba(124, 100, 255, 0.2);
}

/* Curly thinking bubble tail with multiple circles */
.status-bubble::before {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 30%;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 
        -8px 8px 0 -2px rgba(255, 255, 255, 0.8),
        -18px 16px 0 -6px rgba(255, 255, 255, 0.6),
        -24px 24px 0 -8px rgba(255, 255, 255, 0.4);
    animation: bubbleTail 2s ease-in-out infinite 0.5s;
}

/* Additional small bubble for curly effect */
.status-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 45%;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: bubbleTail 2s ease-in-out infinite 1s;
}

@keyframes fadeInBubble {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.5);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0px) scale(1);
    }
}

@keyframes bubbleGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(124, 100, 255, 0.4);
        transform: translateY(0px) scale(1);
    }
    50% {
        box-shadow: 0 12px 35px rgba(124, 100, 255, 0.6);
        transform: translateY(-3px) scale(1.02);
    }
}

@keyframes bubbleTail {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-2px) scale(1.1);
        opacity: 1;
    }
}

.japanese-greeting {
    font-size: 2rem !important;
    text-align: center;
    margin-bottom: 1rem !important;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
    font-weight: 400;
}

.japanese-greeting a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.japanese-greeting a:hover {
    color: #7c64ff;
    transform: scale(1.1);
    text-shadow: 0 0 20px rgba(124, 100, 255, 0.6);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.hero h2 a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero h2 a:hover {
    color: #7c64ff;
    transform: scale(1.05);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.6s forwards;
    background: linear-gradient(45deg, #fff, #7c64ff, #ff6b9d);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out 0.6s forwards, gradientText 3s ease-in-out infinite 1s;
}

@keyframes gradientText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero *,
    .profile-image,
    .btn,
    .status-indicator {
        animation: none !important;
        transition: none !important;
    }
    
    .hero::before,
    .hero::after {
        animation: none !important;
    }
    
    .hero-content {
        opacity: 1;
        transform: none;
    }
    
    .hero h1,
    .hero h2,
    .hero .subtitle,
    .hero .description,
    .status-badge,
    .profile-image,
    .math-formula,
    .cta-buttons {
        opacity: 1;
        animation: none !important;
    }
}

.hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

.hero .description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    animation: fadeInUp 1s ease-out 1.2s forwards;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.1s forwards;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    position: relative;
    animation: statusPulse 2s infinite;
}

.status-indicator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: #00ff88;
    border-radius: 50%;
    opacity: 0.6;
    animation: statusPulse 2s infinite 0.5s;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: #00ff88;
    border-radius: 50%;
    opacity: 0.3;
    animation: statusPulse 2s infinite 1s;
}

@keyframes statusPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.3; 
        transform: scale(1.3);
    }
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    object-fit: cover;
    opacity: 0;
    animation: fadeInScale 1.2s ease-out 1.5s forwards, float 6s ease-in-out infinite 3s;
    transition: all 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(124, 100, 255, 0.5);
}

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

.math-formula {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: 1rem 0 2rem 0;
    font-family: 'Times New Roman', serif;
    font-weight: 400;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1.8s forwards;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease-out 2.1s forwards;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #7c64ff, #ff6b9d);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 100, 255, 0.4);
    transform: translateY(0);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #6a52e6, #e5588a);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 100, 255, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* About section */
.about-section {
    padding: 4rem 0;
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--primary-color);
}

.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
}

/* Quick links section */
.quick-links {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.link-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: var(--text-color);
}

.link-card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.link-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.link-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Page content */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

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

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
}

.page-body {
    font-size: 1.125rem;
    line-height: 1.8;
}

/* Education timeline */
.education-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary-color);
}

.education-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.education-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.education-percentage {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Achievement cards */
.achievement {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.achievement h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.achievement-icon {
    color: var(--accent-color);
}

.achievement p {
    line-height: 1.6;
}

.achievement-details {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.achievement-details ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Contact form */
.contact-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.contact-icon {
    color: var(--secondary-color);
    font-size: 1.25rem;
}

/* CV section */
.cv-download {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.cv-download .btn {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Social links */
.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

.social-link:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Footer */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text) !important;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--footer-text) !important;
}

.footer-section p {
    color: var(--footer-text-muted) !important;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--footer-text-muted) !important;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--footer-text) !important;
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--footer-border);
    padding-top: 1rem;
    text-align: center;
    color: var(--footer-text-muted) !important;
}

/* Footer social links specific styling */
.site-footer .social-link {
    background: rgba(255, 255, 255, 0.15);
    color: var(--footer-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.site-footer .social-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--footer-text) !important;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Ensure all footer text is visible with stronger contrast */
.site-footer * {
    color: var(--footer-text) !important;
}

.site-footer h3 {
    color: var(--footer-text) !important;
    font-weight: 600 !important;
}

.site-footer p {
    color: var(--footer-text) !important;
    opacity: 0.9;
    font-weight: 400;
}

.footer-section p {
    color: var(--footer-text) !important;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    font-weight: 400;
}

.footer-links a {
    color: var(--footer-text) !important;
    opacity: 0.8;
    font-weight: 400;
}

.footer-links a:hover {
    color: var(--footer-text) !important;
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid var(--footer-border);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: var(--footer-text) !important;
    opacity: 0.8;
}

/* Math content styling */
.MathJax {
    font-size: 1.1em !important;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--table-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
    vertical-align: top;
    line-height: 1.5;
    color: var(--text-color);
}

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

table tr:nth-child(even) {
    background-color: var(--table-stripe);
}

table tr:hover {
    background-color: var(--table-hover);
}

/* Responsive table */
@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 600px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Comprehensive Markdown Styling */

/* Blockquotes */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--secondary-color);
    background: var(--bg-secondary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

blockquote p {
    margin-bottom: 0.5rem;
}

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

/* Code blocks and inline code */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--code-text);
    border: 1px solid var(--code-border);
}

pre {
    background: var(--pre-bg);
    border: 1px solid var(--pre-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.4;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    color: var(--pre-text);
}

/* Lists */
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

li ul, li ol {
    margin: 0.5rem 0;
}

/* Nested lists */
ul ul, ol ol, ul ol, ol ul {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Definition lists */
dl {
    margin: 1rem 0;
}

dt {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 1rem;
}

dd {
    margin-left: 2rem;
    margin-bottom: 0.5rem;
}

/* Horizontal rules */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2rem 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 1rem 0;
}

/* Figure and figcaption */
figure {
    margin: 1.5rem 0;
    text-align: center;
}

figcaption {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Text formatting */
strong, b {
    font-weight: 600;
    color: var(--primary-color);
}

em, i {
    font-style: italic;
    color: var(--text-muted);
}

mark {
    background: rgba(255, 235, 59, 0.3);
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

del, s {
    text-decoration: line-through;
    color: var(--text-muted);
}

ins, u {
    text-decoration: underline;
    color: var(--secondary-color);
}

small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Superscript and subscript */
sup, sub {
    font-size: 0.75rem;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

/* Abbreviations */
abbr[title] {
    border-bottom: 1px dotted var(--text-muted);
    cursor: help;
    text-decoration: none;
}

/* Keyboard input */
kbd {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--text-color);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Sample output */
samp {
    font-family: var(--font-mono);
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Variable */
var {
    font-family: var(--font-mono);
    font-style: italic;
    color: var(--secondary-color);
}

/* Details and summary */
details {
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    background: white;
}

summary {
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

summary:hover {
    color: var(--secondary-color);
}

details[open] summary {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Task lists (GitHub style) */
input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Footnotes */
.footnote {
    font-size: 0.875rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    padding-top: 1rem;
}

.footnote-ref {
    font-size: 0.75rem;
    vertical-align: super;
    text-decoration: none;
    color: var(--secondary-color);
}

/* Markdown alerts/callouts */
.markdown-alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.markdown-alert.note {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.markdown-alert.tip {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
}

.markdown-alert.important {
    background: rgba(168, 85, 247, 0.1);
    border-left-color: #a855f7;
}

.markdown-alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.markdown-alert.caution {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

/* Blog Posts Styling */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.post-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.post-header h3 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.post-header h3 a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.post-header h3 a:hover {
    color: var(--secondary-color);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-categories {
    display: flex;
    gap: 0.5rem;
}

.category {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
}

.post-excerpt {
    line-height: 1.5;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.read-more {
    color: var(--secondary-color);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
}

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.no-posts h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.no-posts p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Individual Post Page Styling */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.post-content h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.post-content h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Responsive posts grid */
@media (max-width: 768px) {
    .posts-grid {
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .post-card {
        padding: 1rem;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 100px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }
    
    .nav-items {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: var(--bg-secondary);
        margin-top: 0.5rem;
    }
    
    .nav-more-btn {
        width: 100%;
        justify-content: center;
    }

    .nav-menu.show {
        left: 0;
    }

    .nav-toggle {
        display: flex;
        position: absolute;
        top: 1rem;
        right: 2rem;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        padding: 4rem 0;
        min-height: 90vh;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text {
        order: 2;
        text-align: center;
    }
    
    .hero-image {
        order: 1;
        margin-bottom: 2rem;
    }
    
    .status-bubble {
        font-size: 0.8rem;
        padding: 0.5rem 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .japanese-greeting {
        font-size: 1.8rem !important;
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        animation-delay: 0.3s;
    }

    .hero .subtitle {
        font-size: 1.25rem;
    }
    
    .math-formula {
        font-size: 1.25rem;
        margin: 1rem 0;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .container,
    .nav-container,
    .hero-container {
        padding: 0 1rem;
    }

    .main-content {
        margin-top: 110px;
    }
    
    /* Adjust for non-home pages on mobile */
    body:not(.home) .main-content {
        margin-top: 125px;
        padding-top: 0.75rem;
    }
    
    /* Keep home page spacing on mobile */
    body.home .main-content {
        margin-top: 110px;
        padding-top: 0;
    }

    .page-content {
        padding: 1rem;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .profile-image {
        width: 150px;
        height: 150px;
    }
}

/* Dark mode specific improvements */
[data-theme="dark"] .nav-dropdown-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-menu {
    background-color: var(--bg-color);
}

[data-theme="dark"] .link-card {
    background: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .education-item,
[data-theme="dark"] .achievement,
[data-theme="dark"] .contact-info,
[data-theme="dark"] .details {
    background: var(--bg-color);
}

[data-theme="dark"] .cv-download {
    background: var(--bg-secondary);
}

[data-theme="dark"] .post-card {
    background: var(--bg-color);
}

[data-theme="dark"] .no-posts {
    background: var(--bg-secondary);
}

/* Ensure proper contrast for all text elements */
[data-theme="dark"] strong,
[data-theme="dark"] b {
    color: var(--primary-color);
}

[data-theme="dark"] em,
[data-theme="dark"] i {
    color: var(--text-muted);
}

[data-theme="dark"] .achievement-details {
    background: var(--bg-secondary);
}

[data-theme="dark"] .contact-item {
    background: var(--bg-secondary);
}

[data-theme="dark"] .category {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

[data-theme="dark"] .tag {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

.hero,
.hero::before,
.hero::after {
    transition: background 0.3s ease !important;
}

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

/* Focus states for keyboard navigation */
.nav-link:focus,
.btn:focus,
.social-link:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .nav-toggle,
    .cta-buttons {
        display: none;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .hero {
        background: none;
        color: var(--text-color);
    }
    
    .page-content {
        max-width: none;
        padding: 0;
    }
}

/* Home layout - target only Markdown content between HTML sections */
.main-content > h1:not(.page-title):not([class]),
.main-content > h2:not(.section-title):not([class]),
.main-content > h3:not([class]),
.main-content > h4:not([class]),
.main-content > h5:not([class]),
.main-content > h6:not([class]),
.main-content > p:not([class]),
.main-content > ul:not([class]),
.main-content > ol:not([class]),
.main-content > blockquote:not([class]),
.main-content > pre:not([class]),
.main-content > table:not([class]),
.main-content > hr:not([class]) {
    /* Apply page-content styling to Markdown-generated elements only */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.main-content > h1:not(.page-title):not([class]),
.main-content > h2:not(.section-title):not([class]) {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 3rem;
    color: var(--primary-color);
}

.main-content > h1:not(.page-title):not([class]) {
    font-size: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.main-content > h2:not(.section-title):not([class]) {
    font-size: 2rem;
}

.main-content > h3:not([class]) {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.main-content > h4:not([class]),
.main-content > h5:not([class]),
.main-content > h6:not([class]) {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.main-content > p:not([class]),
.main-content > ul:not([class]),
.main-content > ol:not([class]) {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.main-content > ul:not([class]),
.main-content > ol:not([class]) {
    padding-left: 4rem;
}

.main-content > ul:not([class]) li,
.main-content > ol:not([class]) li {
    margin-bottom: 0.5rem;
}

.main-content > blockquote:not([class]) {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    margin: 2rem auto;
    font-style: italic;
    color: var(--text-muted);
}

.main-content > pre:not([class]),
.main-content > .highlight,
.main-content > div.highlight {
    background-color: var(--pre-bg);
    border-radius: var(--border-radius);
    overflow-x: auto;
    border: 1px solid var(--pre-border);
    box-shadow: var(--shadow);
    /* Apply page-content styling to Markdown-generated elements only */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.main-content > .highlight pre,
.main-content > div.highlight pre {
    background: none;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
    max-width: none;
}

.main-content > pre:not([class]) code {
    color: var(--pre-text);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
}

.main-content > .highlight code,
.main-content > div.highlight code {
    color: var(--pre-text);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
}

.main-content > hr:not([class]) {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 3rem auto;
}

.main-content > table:not([class]) {
    border-collapse: collapse;
    margin: 2rem auto;
}

.main-content > table:not([class]) th,
.main-content > table:not([class]) td {
    border: 1px solid var(--table-border);
    padding: 0.75rem;
    text-align: left;
    color: var(--text-color);
}

.main-content > table:not([class]) th {
    background-color: var(--table-header-bg);
    font-weight: 600;
    color: var(--table-header-text);
}

/* Links in Markdown content */
.main-content > p:not([class]) a,
.main-content > ul:not([class]) a,
.main-content > ol:not([class]) a,
.main-content h3 a,
.main-content h4 a,
.main-content li a {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}

.main-content > p:not([class]) a:hover,
.main-content > ul:not([class]) a:hover,
.main-content > ol:not([class]) a:hover,
.main-content h3 a:hover,
.main-content h4 a:hover,
.main-content li a:hover {
    border-bottom-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Ensure inline code links are properly styled */
.main-content code a {
    color: var(--secondary-color) !important;
    text-decoration: underline;
}

.main-content code a:hover {
    color: var(--primary-color) !important;
}
