/* CodeMaster - Elegant Design */

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

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --accent: #06b6d4;
    --bg: #fafbfc;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    background-image: radial-gradient(at top left, rgba(79, 70, 229, 0.05) 0%, transparent 50%),
        radial-gradient(at bottom right, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
    color: var(--text);
    line-height: 1.7;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.6);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav a {
    color: var(--text);
    margin-left: 24px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

nav a:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #06b6d4 100%);
    color: white;
    padding: 60px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 17px;
    opacity: 0.95;
    position: relative;
}

/* Main */
.main {
    display: flex;
    gap: 32px;
    padding: 40px 24px;
}

.content { flex: 1; }
.sidebar { width: 240px; }

h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

/* Posts */
.posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.posts article {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

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

.posts img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s;
}

.posts article:hover img {
    transform: scale(1.03);
}

.posts h3 {
    font-size: 17px;
    font-weight: 600;
    padding: 16px 18px 6px;
    color: var(--text);
}

.posts p {
    padding: 0 18px 16px;
    color: var(--text-light);
    font-size: 14px;
}

/* Sidebar */
.box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: var(--shadow);
}

.box h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.box li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: all 0.2s;
}

.box li:last-child { border: none; }

.box a {
    color: var(--text);
    font-size: 14px;
    transition: color 0.2s;
}

.box a:hover {
    color: var(--primary);
    padding-left: 6px;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #d1d5db;
    padding: 40px 0;
}

footer p {
    font-size: 14px;
    margin-bottom: 12px;
}

footer a {
    color: #9ca3af;
    text-decoration: none;
    margin: 0 12px;
    font-size: 13px;
    transition: all 0.2s;
}

footer a:hover {
    color: white;
}

/* Article Page */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: var(--shadow);
}

.article-header {
    margin-bottom: 25px;
    text-align: center;
}

.article-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 15px 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 14px;
    color: var(--text);
}

.article-body p {
    margin-bottom: 18px;
    font-size: 16px;
    line-height: 1.8;
}

.article-body ul {
    margin: 20px 0;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 10px;
}

.article-body img {
    width: 100%;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: var(--shadow-lg);
}

/* Page content */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.page-content h1 {
    font-size: 28px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-content h2 {
    font-size: 18px;
    margin: 25px 0 12px;
    border: none;
    color: var(--text);
}

.page-content p {
    margin-bottom: 14px;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .main { flex-direction: column; }
    .sidebar { width: 100%; }
    header .wrap { flex-direction: column; gap: 12px; }
    nav a { margin: 0 8px; }
    .hero h1 { font-size: 28px; }
    .posts img { height: 180px; }
}
