@import url('https://fonts.googleapis.com/css2?family=Kiwi+Maru:wght@400;500&family=Zen+Maru+Gothic:wght@400;700&family=Outfit:wght@400;600&display=swap');

:root {
    /* Premium Palette - Warm & Sophisticated */
    --primary: hsl(20, 30%, 30%);
    --primary-light: hsl(20, 20%, 45%);
    --accent-hs: hsl(175, 40%, 50%);
    --accent-uni: hsl(340, 80%, 65%);
    --accent-life: hsl(90, 45%, 55%);
    --accent-mind: hsl(260, 45%, 65%);
    --accent-event: hsl(35, 95%, 55%);
    --accent-aruaru: hsl(285, 45%, 70%);
    --accent-tool: hsl(200, 80%, 65%);
    
    --bg-paper: hsl(45, 20%, 97%);
    --bg-desk: hsl(45, 15%, 85%);
    --card-bg: hsla(0, 0%, 100%, 0.85);
    --glass-bg: hsla(0, 0%, 100%, 0.7);
    --text-main: hsl(20, 40%, 10%);
    --text-muted: hsl(20, 20%, 40%);
    
    --font-hand: 'Kiwi Maru', serif;
    --font-main: 'Zen Maru Gothic', sans-serif;
    --font-accent: 'Outfit', sans-serif;
    
    --shadow-sm: 0 4px 12px hsla(20, 30%, 20%, 0.05);
    --shadow-md: 0 12px 32px hsla(20, 30%, 20%, 0.1);
    --shadow-lg: 0 24px 64px hsla(20, 30%, 20%, 0.15);
    
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

[data-theme="dark"] {
    --bg-paper: hsl(210, 20%, 12%);
    --bg-desk: hsl(210, 20%, 8%);
    --card-bg: hsla(210, 20%, 18%, 0.85);
    --glass-bg: hsla(210, 20%, 12%, 0.75);
    --text-main: hsl(210, 10%, 90%);
    --text-muted: hsl(210, 10%, 65%);
    --primary: hsl(20, 20%, 80%);
    --primary-light: hsl(20, 15%, 70%);
    
    --shadow-sm: 0 4px 12px hsla(0, 0%, 0%, 0.3);
    --shadow-md: 0 12px 32px hsla(0, 0%, 0%, 0.4);
    --shadow-lg: 0 24px 64px hsla(0, 0%, 0%, 0.5);
}

/* Global Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

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

body {
    background-color: var(--bg-desk);
    background-image: 
        radial-gradient(hsla(20, 30%, 20%, 0.05) 1.5px, transparent 1.5px);
    background-size: 40px 40px;
    font-family: var(--font-main);
    color: var(--text-main);
    line-height: 1.7;
    transition: background 0.6s ease, color 0.6s ease;
    overflow-x: hidden;
}

/* Glassmorphism Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-title {
    font-family: var(--font-hand);
    font-size: 2rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-title::before {
    content: '🖋️';
    font-size: 1.5rem;
}

.search-container {
    position: relative;
    max-width: 450px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1.5rem 0.8rem 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid hsla(20, 30%, 20%, 0.1);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px hsla(0, 0%, 0%, 0.02);
}

.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px hsla(20, 30%, 20%, 0.05);
}

.search-container::after {
    content: '🔍';
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 1rem;
}

.mode-toggle {
    background: var(--card-bg);
    border: 1px solid hsla(0, 0%, 100%, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.mode-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-overlay {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    padding: 5rem 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    text-align: center;
    border: 1px solid hsla(0, 0%, 100%, 0.2);
}

.hero-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, hsla(175, 40%, 50%, 0.05), hsla(340, 80%, 65%, 0.05));
    pointer-events: none;
}

.hero h2 {
    font-family: var(--font-hand);
    font-size: 3.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Roadmap Section */
.roadmap-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.roadmap-title {
    font-family: var(--font-hand);
    font-size: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    color: var(--primary);
}

.roadmap-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding-bottom: 1rem;
}

.roadmap-node {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border-top: 6px solid var(--accent-hs);
    transition: var(--transition);
    position: relative;
}

.roadmap-node:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.node-spring { border-top-color: var(--accent-life); }
.node-summer { border-top-color: var(--accent-tool); }
.node-autumn { border-top-color: var(--accent-event); }
.node-winter { border-top-color: var(--accent-hs); }

.roadmap-node h4 {
    font-family: var(--font-hand);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.roadmap-node ul { list-style: none; }
.roadmap-node li { margin-bottom: 0.8rem; font-size: 0.95rem; }
.roadmap-node a { 
    text-decoration: none; 
    color: var(--text-main); 
    border-bottom: 1px dashed hsla(0, 0%, 0%, 0.1);
    transition: var(--transition);
}

.roadmap-node a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

.current-label {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent-uni);
    color: white;
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 8px hsla(340, 80%, 65%, 0.3);
}

/* Navigation Filters */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 4rem auto;
    flex-wrap: wrap;
    max-width: 1000px;
}

.filter-btn {
    padding: 0.7rem 1.8rem;
    border-radius: var(--radius-lg);
    border: 1px solid hsla(20, 30%, 20%, 0.1);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: var(--font-hand);
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 20px hsla(20, 30%, 20%, 0.2);
}

/* Article Grid */
.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto 6rem;
    padding: 0 2rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-md);
}

.article-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-tag {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 1rem;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 1.2rem;
    color: white;
    align-self: flex-start;
    box-shadow: 0 4px 8px hsla(0, 0%, 0%, 0.1);
}

.tag-hs { background: var(--accent-hs); }
.tag-uni { background: var(--accent-uni); }
.tag-life { background: var(--accent-life); }
.tag-mind { background: var(--accent-mind); }
.tag-event { background: var(--accent-event); }
.tag-aruaru { background: var(--accent-aruaru); }
.tag-tool { background: var(--accent-tool); }

.article-card h3 {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--primary);
}

.article-card p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid hsla(0, 0%, 0%, 0.05);
    padding-top: 1.2rem;
    font-family: var(--font-accent);
}

.read-time {
    background: hsla(20, 30%, 20%, 0.05);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
}

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: var(--transition);
}

#backToTop:hover {
    transform: translateY(-8px);
    background: var(--primary-light);
}

/* Footer */
footer {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 6rem 2rem;
    text-align: center;
    border-top: 1px solid hsla(0, 0%, 0%, 0.05);
}

footer nav {
    margin-bottom: 2.5rem;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 1.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

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

footer p {
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
    .roadmap-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1.5rem;
    }
    .search-container {
        max-width: 100%;
    }
    .hero h2 {
        font-size: 2.4rem;
    }
    .roadmap-container {
        grid-template-columns: 1fr;
    }
    .main-content {
        grid-template-columns: 1fr;
    }
    #backToTop {
        bottom: 2rem;
        right: 2rem;
        width: 50px;
        height: 50px;
    }
}
