/* ===== sasanokusa Custom Theme ===== */
/* A modern, dark-first design with gradient accents */

/* --- CSS Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- CSS Variables --- */
:root {
    /* Colors - Dark Mode (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #222230;

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #a855f7;
    --accent-gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Typography */
    --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Layout */
    --max-width: 1000px;
    --header-height: 64px;
}

/* --- Light Mode --- */
.light {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f5;

    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* --- Base Styles --- */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.light .header {
    background: rgba(250, 250, 250, 0.8);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--transition-normal);
}

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

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

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

.light .theme-toggle .icon-moon {
    display: none;
}

.light .theme-toggle .icon-sun {
    display: block;
}

/* ===== MAIN ===== */
.main {
    min-height: calc(100vh - var(--header-height) - 80px);
    padding: var(--space-12) 0;
}

/* ===== FOOTER ===== */
.footer {
    padding: var(--space-8) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: var(--accent-1);
}

/* ===== HERO SECTION (Resume Page) ===== */
.hero {
    text-align: center;
    padding: var(--space-16) 0;
}

.hero-avatar {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto var(--space-8);
}

.avatar-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: var(--accent-gradient);
    animation: spin 10s linear infinite;
}

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

.avatar-image {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    border: 4px solid var(--bg-primary);
}

.hero-name {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-3);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero-social {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-1);
    color: white;
    border-color: var(--accent-1);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.social-link svg {
    width: 22px;
    height: 22px;
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: var(--space-16);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

/* About Section */
.about-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-4);
}

.skill-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.skill-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.skill-icon {
    font-size: 1.5rem;
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== STATUS CARD ===== */
.status-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
}

.status-card:hover {
    border-color: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: #22c55e;
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-arrow {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.status-card:hover .status-arrow {
    transform: translateX(4px);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-uptime {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.uptime-bar {
    display: flex;
    gap: 3px;
    padding: var(--space-4) 0;
}

.uptime-day {
    flex: 1;
    height: 32px;
    border-radius: 3px;
    transition: transform var(--transition-fast);
}

.uptime-day.up {
    background: #22c55e;
}

.uptime-day.down {
    background: #ef4444;
}

.uptime-day:hover {
    transform: scaleY(1.2);
}

.uptime-hour {
    flex: 1;
    height: 32px;
    border-radius: 3px;
    transition: transform var(--transition-fast);
}

.uptime-hour.up {
    background: #22c55e;
}

.uptime-hour.down {
    background: #ef4444;
}

.uptime-hour:hover {
    transform: scaleY(1.2);
}

/* ===== BLOG CARDS ===== */
.posts-grid {
    display: grid;
    gap: var(--space-6);
}

.post-card {
    display: block;
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

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

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    line-height: 1.4;
}

.post-card-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.post-card-summary {
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.tag {
    padding: var(--space-1) var(--space-3);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--accent-1);
    color: white;
}

/* Recent Posts (Home Page) */
.recent-posts {
    display: grid;
    gap: var(--space-4);
}

.recent-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.recent-post-item:hover {
    border-color: var(--accent-1);
    transform: translateX(8px);
}

.recent-post-info {
    flex: 1;
}

.recent-post-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

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

.recent-post-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.recent-post-item:hover .recent-post-arrow {
    transform: translateX(4px);
    color: var(--accent-1);
}

/* View All Button */
.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-top: var(--space-8);
    transition: all var(--transition-normal);
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

/* ===== SINGLE POST ===== */
.post-header {
    margin-bottom: var(--space-8);
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: var(--space-4);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.9;
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: var(--space-12);
    margin-bottom: var(--space-4);
}

.post-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

.post-content p {
    margin-bottom: var(--space-6);
}

.post-content a {
    color: var(--accent-1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content a:hover {
    color: var(--accent-2);
}

.post-content ul,
.post-content ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

.post-content li {
    margin-bottom: var(--space-2);
}

.post-content blockquote {
    border-left: 4px solid var(--accent-1);
    padding-left: var(--space-6);
    margin: var(--space-6) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content img {
    border-radius: var(--radius-md);
    margin: var(--space-6) 0;
}

/* Code Blocks */
.post-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    overflow-x: auto;
    margin: var(--space-6) 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-content code {
    font-family: var(--font-mono);
}

.post-content :not(pre) > code {
    background: var(--bg-card);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--accent-1);
}

/* ===== PAGE HEADER ===== */
.page-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: var(--space-3);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination .page-item:not(.disabled) .page-link:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .hero-name {
        font-size: 2.25rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .hero-avatar {
        width: 120px;
        height: 120px;
    }

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

    .post-title {
        font-size: 1.75rem;
    }

    .page-title {
        font-size: 2rem;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-4);
    }

    .hero-name {
        font-size: 1.875rem;
    }

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

    .nav-links {
        display: none;
    }
}
