:root {
  --primary: #f05a28;
  --primary-dark: #c43f15;
  --secondary: #111827;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e5e7eb;
  --shadow-soft: 0 18px 55px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #fffaf6 0%, #f7fafc 44%, #ffffff 100%);
  color: var(--secondary);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

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

.site-shell {
  min-height: 100vh;
}

.site-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 18rem;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 900;
}

.brand img {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 1.2rem;
}

.brand small {
  display: block;
  color: var(--primary);
  font-size: 0.85rem;
}

.main-nav {
  display: grid;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.main-nav a {
  border-radius: 0.375rem;
  padding: 0.85rem 1rem;
  color: #374151;
  font-weight: 800;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--primary);
  color: #ffffff;
}

.sidebar-cta {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-soft);
  padding: 1rem;
}

.sidebar-cta span {
  display: block;
  color: #374151;
  font-weight: 800;
}

.sidebar-cta a,
.button-primary {
  display: inline-flex;
  justify-content: center;
  margin-top: 1rem;
  width: 100%;
  border-radius: 0.375rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-weight: 900;
}

.mobile-header {
  display: none;
}

.site-main {
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  padding-left: 18rem;
}

.blog-hero {
  position: relative;
  overflow: hidden;
  background: var(--secondary);
  color: #ffffff;
  padding: 5rem clamp(1rem, 5vw, 4rem);
}

.blog-hero::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.98), rgba(17, 24, 39, 0.72));
  content: "";
}

.blog-hero > * {
  position: relative;
  z-index: 1;
  max-width: 55rem;
}

.blog-hero.compact {
  padding-block: 3.5rem;
}

.kicker {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.blog-hero h1,
.article-header h1 {
  margin: 1rem 0 0;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.blog-hero p {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  max-width: 84rem;
  margin: 0 auto;
  padding: clamp(1rem, 5vw, 4rem);
}

.post-card,
.article-page {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.post-card {
  display: flex;
  min-width: 0;
  min-height: 18rem;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.post-card h2 {
  margin: 1rem 0 0;
  font-size: 1.35rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.post-card h2 a:hover,
.read-more:hover,
.site-footer a:hover {
  color: var(--primary);
}

.post-excerpt {
  margin-top: 1rem;
  color: #475569;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.post-excerpt,
.post-excerpt * {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.more {
  display: none;
}

.read-more {
  display: inline-flex;
  margin-top: auto;
  padding-top: 1rem;
  color: var(--primary);
  font-weight: 900;
}

.pagination {
  padding: 0 clamp(1rem, 5vw, 4rem) 4rem;
  font-weight: 900;
}

.article-page {
  width: min(72rem, calc(100% - 2rem));
  min-width: 0;
  margin: clamp(1rem, 5vw, 4rem) auto;
  overflow: hidden;
  padding: clamp(1.25rem, 5vw, 4rem);
}

.article-header {
  max-width: 60rem;
}

.article-content {
  margin-top: 2rem;
  max-width: 100%;
  color: #1f2937;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.article-content * {
  max-width: 100%;
}

.article-content img,
.article-content video,
.article-content iframe {
  height: auto;
  border-radius: 0.5rem;
}

.article-content table {
  display: block;
  overflow-x: auto;
}

.article-content h2,
.article-content h3 {
  margin-top: 2rem;
  color: var(--secondary);
}

.article-content pre {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #e5e7eb;
  padding: 1rem;
}

.article-content code {
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.article-content pre code {
  overflow-wrap: normal;
}

.article-footer {
  margin-top: 2rem;
}

.article-footer a {
  display: inline-flex;
  margin: 0 0.4rem 0.4rem 0;
  border-radius: 0.375rem;
  background: var(--surface-soft);
  padding: 0.45rem 0.7rem;
  color: var(--primary);
  font-weight: 800;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  margin-left: 18rem;
  background: var(--secondary);
  color: #ffffff;
  padding: 3rem clamp(1rem, 5vw, 4rem);
}

.site-footer p {
  color: #cbd5e1;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-content: start;
  color: #cbd5e1;
  font-weight: 800;
}

@media (max-width: 1023px) {
  .site-sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    padding: 0.85rem 1rem;
  }

  .mobile-header .brand img {
    width: 2.25rem;
    height: 2.25rem;
  }

  .mobile-blog-link {
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.55rem 0.8rem;
    font-weight: 900;
  }

  .site-main,
  .site-footer {
    margin-left: 0;
    padding-left: 0;
  }

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

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
