@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,700;1,9..144,300&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --ink: #0e0e0e;
  --paper: #f5f2eb;
  --cream: #ede9df;
  --accent: #c94f2c;
  --muted: #6b6560;
  --border: #d4cfc6;
  --code-bg: #1a1a2e;
  --code-text: #a8d8a8;
  --tag-bg: #e8e4db;
  --white: #ffffff;
  --shadow: rgba(14,14,14,0.08);
  --max-width: 1200px;
  --col: 760px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: 'DM Sans', sans-serif; font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: 'Fraunces', serif; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }
.container--narrow { max-width: var(--col); margin: 0 auto; padding: 0 32px; }

/* HEADER */
.site-header { background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 100; border-bottom: 3px solid var(--accent); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-logo { font-family: 'Fraunces', serif; font-size: 1.35rem; font-weight: 700; color: var(--paper); display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; background: var(--accent); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-family: 'DM Mono', monospace; font-size: 0.75rem; color: white; font-weight: 500; flex-shrink: 0; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { font-size: 0.88rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #c8c3bb; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-subscribe { background: var(--accent); color: white; padding: 8px 18px; border-radius: 3px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; transition: background 0.2s; }
.nav-subscribe:hover { background: #b03f1f; }

/* HERO */
.hero { background: var(--ink); color: var(--paper); padding: 80px 0 64px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -60px; right: -80px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(201,79,44,0.15) 0%, transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: center; }
.hero-eyebrow { font-family: 'DM Mono', monospace; font-size: 0.78rem; color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.hero-eyebrow::before { content: ''; display: block; width: 28px; height: 2px; background: var(--accent); }
.hero-title { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; margin-bottom: 20px; color: var(--paper); }
.hero-title em { font-style: italic; color: var(--accent); }
.hero-desc { color: #9e9890; font-size: 1.05rem; max-width: 500px; margin-bottom: 32px; line-height: 1.8; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 3px; font-size: 0.9rem; font-weight: 600; transition: all 0.2s; cursor: pointer; border: none; font-family: 'DM Sans', sans-serif; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #b03f1f; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,79,44,0.4); }
.btn-secondary { background: transparent; color: var(--paper); border: 1.5px solid #3a3a3a; }
.btn-secondary:hover { border-color: var(--paper); }
.hero-stats { display: flex; gap: 32px; margin-top: 48px; padding-top: 32px; border-top: 1px solid #2a2a2a; }
.stat-num { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 700; color: var(--paper); }
.stat-label { font-size: 0.78rem; color: #6b6560; letter-spacing: 0.06em; text-transform: uppercase; }
.hero-featured { background: #1a1a1a; border-radius: 8px; overflow: hidden; border: 1px solid #2a2a2a; }
.hero-feat-img { width: 100%; height: 180px; display: flex; align-items: center; justify-content: center; font-size: 4rem; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.hero-feat-body { padding: 24px; }
.hero-feat-tag { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.hero-feat-title { font-family: 'Fraunces', serif; font-size: 1.2rem; color: var(--paper); line-height: 1.3; margin-bottom: 12px; }
.hero-feat-meta { font-size: 0.8rem; color: #6b6560; }

/* CATEGORY BAR */
.category-bar { background: var(--cream); border-bottom: 1px solid var(--border); }
.cat-inner { display: flex; overflow-x: auto; scrollbar-width: none; }
.cat-inner::-webkit-scrollbar { display: none; }
.cat-btn { background: none; border: none; border-bottom: 3px solid transparent; padding: 16px 22px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.cat-btn:hover { color: var(--ink); }
.cat-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* POSTS */
.posts-section { padding: 64px 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 40px; }
.section-title { font-size: 1.6rem; }
.see-all { font-size: 0.84rem; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 5px; transition: gap 0.2s; }
.see-all:hover { gap: 10px; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.posts-grid--featured { grid-template-columns: 2fr 1fr 1fr; }
.post-card { background: var(--white); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); transition: transform 0.25s, box-shadow 0.25s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px var(--shadow); }
.post-card--large .post-img { height: 260px; }
.post-img { width: 100%; height: 180px; display: flex; align-items: center; justify-content: center; font-size: 3rem; flex-shrink: 0; }
.post-img--analysis { background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); }
.post-img--engineering { background: linear-gradient(135deg, #1a1a2e, #16213e, #533483); }
.post-img--architecture { background: linear-gradient(135deg, #0d1b2a, #1b4332, #40916c); }
.post-img--management { background: linear-gradient(135deg, #2d0320, #6a0572, #ab83a1); }
.post-img--default { background: linear-gradient(135deg, #1a1a2e, #2d3561, #c94f2c); }
.post-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.post-tag { display: inline-block; font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 3px; background: var(--tag-bg); color: var(--muted); margin-bottom: 12px; }
.post-tag--analysis { background: #d4eaf7; color: #1a5276; }
.post-tag--engineering { background: #e8d5f5; color: #5b2c6f; }
.post-tag--architecture { background: #d5f5e3; color: #1e8449; }
.post-tag--management { background: #fdebd0; color: #784212; }
.post-title { font-family: 'Fraunces', serif; font-size: 1.12rem; line-height: 1.3; margin-bottom: 10px; color: var(--ink); flex: 1; }
.post-card:hover .post-title { color: var(--accent); }
.post-excerpt { font-size: 0.88rem; color: var(--muted); line-height: 1.65; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 0.78rem; color: var(--muted); margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; }
.post-author-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: white; font-weight: 700; flex-shrink: 0; }
.post-read-time { margin-left: auto; font-family: 'DM Mono', monospace; font-size: 0.72rem; }

/* FEATURED STRIP */
.featured-strip { background: var(--ink); color: var(--paper); padding: 56px 0; }
.featured-strip .section-title { color: var(--paper); }
.featured-strip .see-all { color: var(--accent); }
.featured-strip .post-card { background: #1a1a1a; border-color: #2a2a2a; }
.featured-strip .post-title { color: var(--paper); }
.featured-strip .post-excerpt { color: #6b6560; }
.featured-strip .post-meta { border-color: #2a2a2a; }
.featured-strip .post-tag--analysis { background: #1a2e3d; color: #5dade2; }
.featured-strip .post-tag--engineering { background: #2d1b3d; color: #bb8fce; }
.featured-strip .post-tag--architecture { background: #1b2e1f; color: #58d68d; }
.featured-strip .post-tag--management { background: #3d2611; color: #f0b27a; }

/* SIDEBAR */
.content-with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 56px; padding: 64px 0; }
.sidebar-widget { margin-bottom: 40px; }
.widget-title { font-family: 'Fraunces', serif; font-size: 1rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.newsletter-widget { background: var(--ink); color: var(--paper); padding: 24px; border-radius: 6px; }
.newsletter-widget .widget-title { color: var(--paper); border-color: #3a3a3a; }
.newsletter-widget p { font-size: 0.88rem; color: #9e9890; margin-bottom: 16px; }
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-form input { background: #1a1a1a; border: 1px solid #3a3a3a; border-radius: 3px; padding: 10px 14px; color: var(--paper); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; outline: none; transition: border-color 0.2s; }
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form input::placeholder { color: #5a5a5a; }
.newsletter-form button { background: var(--accent); color: white; border: none; border-radius: 3px; padding: 11px; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.newsletter-form button:hover { background: #b03f1f; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { background: var(--tag-bg); color: var(--muted); padding: 5px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 500; transition: all 0.2s; cursor: pointer; }
.tag-pill:hover { background: var(--accent); color: white; }
.recent-list { display: flex; flex-direction: column; gap: 16px; }
.recent-item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.recent-thumb { width: 56px; height: 56px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.recent-item-title { font-family: 'Fraunces', serif; font-size: 0.9rem; line-height: 1.3; margin-bottom: 4px; transition: color 0.2s; }
.recent-item:hover .recent-item-title { color: var(--accent); }
.recent-item-date { font-size: 0.75rem; color: var(--muted); }

/* ARTICLE */
.article-hero { background: var(--ink); color: var(--paper); padding: 72px 0 64px; }
.article-title { font-size: clamp(2rem, 4.5vw, 3rem); color: var(--paper); margin-bottom: 20px; max-width: 820px; }
.article-subtitle { font-size: 1.15rem; color: #9e9890; max-width: 680px; margin-bottom: 32px; line-height: 1.75; }
.article-byline { display: flex; align-items: center; gap: 14px; }
.byline-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1rem; color: white; font-weight: 700; flex-shrink: 0; }
.byline-info { font-size: 0.88rem; }
.byline-name { color: var(--paper); font-weight: 600; }
.byline-date { color: #6b6560; }
.article-body { padding: 64px 0; }
.article-content h2 { font-size: 1.7rem; margin: 48px 0 20px; }
.article-content h3 { font-size: 1.25rem; margin: 36px 0 16px; }
.article-content p { margin-bottom: 24px; line-height: 1.85; }
.article-content ul, .article-content ol { margin: 0 0 24px 24px; line-height: 1.85; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote { border-left: 4px solid var(--accent); padding: 16px 24px; margin: 32px 0; background: var(--cream); border-radius: 0 6px 6px 0; font-family: 'Fraunces', serif; font-size: 1.12rem; font-style: italic; color: var(--muted); }
.article-content code { font-family: 'DM Mono', monospace; font-size: 0.85em; background: var(--cream); padding: 2px 7px; border-radius: 3px; color: var(--accent); }
.article-content pre { background: var(--code-bg); color: var(--code-text); padding: 28px; border-radius: 8px; overflow-x: auto; margin: 28px 0; font-family: 'DM Mono', monospace; font-size: 0.88rem; line-height: 1.75; }
.article-content pre code { background: none; padding: 0; color: inherit; }
.callout { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 20px 24px; margin: 28px 0; display: flex; gap: 14px; }
.callout-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.callout-body { font-size: 0.92rem; }
.callout-body strong { display: block; margin-bottom: 4px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* ABOUT */
.about-hero { background: var(--ink); padding: 80px 0; color: var(--paper); text-align: center; }
.about-hero h1 { font-size: 3rem; color: var(--paper); margin-bottom: 20px; }
.about-hero p { color: #9e9890; max-width: 560px; margin: 0 auto; font-size: 1.05rem; line-height: 1.8; }
.about-content { max-width: 820px; margin: 0 auto; padding: 72px 32px; }
.about-content h2 { font-size: 1.8rem; margin: 48px 0 20px; }
.about-content p { margin-bottom: 24px; line-height: 1.85; }
.topics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 32px 0; }
.topic-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 24px; display: flex; gap: 16px; align-items: flex-start; transition: transform 0.2s, box-shadow 0.2s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow); }
.topic-icon { font-size: 2rem; flex-shrink: 0; }
.topic-title { font-family: 'Fraunces', serif; font-size: 1.05rem; margin-bottom: 6px; }
.topic-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* FOOTER */
.site-footer { background: #080808; color: var(--paper); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand-desc { font-size: 0.9rem; color: #6b6560; margin: 16px 0 24px; line-height: 1.75; }
.footer-social { display: flex; gap: 12px; }
.social-btn { width: 36px; height: 36px; border-radius: 4px; background: #1a1a1a; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: #6b6560; transition: all 0.2s; cursor: pointer; }
.social-btn:hover { background: var(--accent); color: white; }
.footer-col-title { font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #4a4a4a; margin-bottom: 20px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-size: 0.9rem; color: #6b6560; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid #1a1a1a; padding: 24px 0; display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: #4a4a4a; }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 48px 0; }
.page-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: all 0.2s; border: 1px solid var(--border); background: var(--white); color: var(--ink); }
.page-btn:hover, .page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* PROGRESS BAR */
.progress-bar { position: fixed; top: 67px; left: 0; width: 0%; height: 3px; background: var(--accent); z-index: 99; transition: width 0.1s linear; }

/* BREADCRUMB */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #6b6560; margin-bottom: 20px; font-family: 'DM Mono', monospace; }
.breadcrumb a { color: var(--accent); }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.post-card { animation: fadeUp 0.4s ease both; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-featured { display: none; }
  .posts-grid--featured, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  .container, .container--narrow { padding: 0 20px; }
  .posts-grid, .posts-grid--featured { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .topics-grid, .sidebar { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
}
