@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:root {
  --bg: #f2f1ed;
  --ink: #1f2422;
  --muted: #6c706a;
  --line: rgba(31, 36, 34, 0.12);
  --card: #fbfaf7;
  --accent: #0f5b4f;
  --accent-2: #f07a3f;
  --shadow: 0 18px 45px rgba(31, 36, 34, 0.12);
  --soft-shadow: 0 8px 24px rgba(31, 36, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", "Manrope", "Gill Sans", "Trebuchet MS", sans-serif;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 22px 70px;
  position: relative;
  animation: pageIn 0.6s ease;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.25;
  pointer-events: none;
}

.site-header {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1.2fr;
  align-items: center;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  display: block;
  box-shadow: var(--soft-shadow);
}

.logo-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-tagline {
  font-size: 12px;
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 14px;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  position: relative;
  padding-bottom: 4px;
}

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

.page a:hover {
  color: inherit;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

.search-box,
.search-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.search-box input,
.search-mini input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  flex: 1;
  box-shadow: inset 0 0 0 1px rgba(31, 36, 34, 0.03);
}

.search-box button,
.search-mini button {
  padding: 8px 14px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.ticker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

.ticker-label {
  background: var(--accent);
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.ticker-items {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 2.2fr 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 12px;
}

.section-title a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}

.section-title.compact {
  margin-top: 22px;
}

.list,
.mini-list {
  display: grid;
  gap: 14px;
}

.list-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  animation: rise 0.4s ease forwards;
  animation-delay: calc(var(--i) * 60ms);
  opacity: 0;
  text-decoration: none;
  color: inherit;
}

.list-title {
  font-size: 13px;
  font-weight: 700;
}

.list-meta,
.mini-meta,
.meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.mini-item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.mini-title {
  font-size: 14px;
  font-weight: 700;
}

.featured {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 16px;
  overflow: hidden;
}

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

.featured-body {
  padding: 16px 18px 18px;
}

.featured h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.featured p {
  color: var(--muted);
  margin: 0 0 8px;
}

.post-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.post-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  animation: rise 0.4s ease forwards;
  animation-delay: calc(var(--i) * 80ms);
  opacity: 0;
}

.post-row a {
  color: inherit;
  text-decoration: none;
}

.post-row h3 {
  margin: 8px 0;
  font-size: 18px;
}

.post-row p {
  margin: 0;
  color: var(--muted);
}

.card-stack {
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--soft-shadow);
  border-radius: 14px;
  overflow: hidden;
  animation: rise 0.4s ease forwards;
  animation-delay: calc(var(--i) * 80ms);
  opacity: 0;
}

.card-body {
  padding: 12px 14px 14px;
}

.card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.lower-grid {
  display: grid;
  grid-template-columns: 2.6fr 1fr;
  gap: 22px;
  padding-top: 24px;
  position: relative;
  z-index: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 16px;
  overflow: hidden;
  animation: rise 0.4s ease forwards;
  animation-delay: calc(var(--i) * 80ms);
  opacity: 0;
}

.grid-body {
  padding: 14px 16px 18px;
}

.grid-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.grid-body a {
  color: inherit;
  text-decoration: none;
}

.grid-body p {
  margin: 0 0 8px;
  color: var(--muted);
}

.sidebar {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.side-block {
  margin-bottom: 20px;
}

.side-block h4 {
  margin: 0 0 10px;
}

.side-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.cats li {
  text-transform: capitalize;
}

.thumb {
  background: #d9d6cc;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.15), transparent 60%);
  mix-blend-mode: screen;
}

.thumb.has-image::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 50%);
  mix-blend-mode: normal;
}

.category-hero {
  padding: 16px 0 24px;
}

.category-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.category-grid {
  display: grid;
  grid-template-columns: 2.6fr 1fr;
  gap: 22px;
}

.category-grid .grid a {
  color: inherit;
  text-decoration: none;
}

.category-page .sidebar {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.category-page .sidebar a {
  color: var(--muted);
  text-decoration: none;
}

.category-page .sidebar a:hover {
  color: var(--ink);
}

.category-page .divider {
  color: var(--muted);
  margin: 0 6px;
}

.tag-page .sidebar {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.tag-page .sidebar a {
  color: var(--muted);
  text-decoration: none;
}

.tag-page .sidebar a:hover {
  color: var(--ink);
}

.tag-page .divider {
  color: var(--muted);
  margin: 0 6px;
}

@media (max-width: 900px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-page .sidebar {
    border-left: none;
    padding-left: 0;
  }
}

.search-hero {
  padding: 16px 0 24px;
}

.search-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.search-grid {
  display: grid;
  grid-template-columns: 2.6fr 1fr;
  gap: 22px;
}

.search-grid .grid a {
  color: inherit;
  text-decoration: none;
}

.search-page .sidebar {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.search-page .sidebar a {
  color: var(--muted);
  text-decoration: none;
}

.search-page .sidebar a:hover {
  color: var(--ink);
}

@media (max-width: 900px) {
  .search-grid {
    grid-template-columns: 1fr;
  }

  .search-page .sidebar {
    border-left: none;
    padding-left: 0;
  }
}

.thumb.small {
  height: 120px;
}

.thumb.tiny {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(31, 36, 34, 0.18);
}

.thumb.medium {
  height: 150px;
}

.thumb.large {
  height: 180px;
}

.thumb.wide {
  height: 240px;
  border-bottom: 1px solid var(--line);
}

.tags {
  display: flex;
  gap: 6px;
  padding: 10px;
  flex-wrap: wrap;
}

.tags span {
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

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

.thumb-keyboard {
  background: linear-gradient(140deg, #cfd5db, #7f8790);
}

.thumb-imac {
  background: linear-gradient(140deg, #d1d8e2, #8b929c);
}

.thumb-mint {
  background: linear-gradient(140deg, #2f2f2f, #111111);
}

.thumb-ubuntu {
  background: linear-gradient(140deg, #f07a3f, #a12b05);
}

.thumb-wine {
  background: linear-gradient(140deg, #8b1c2c, #3b0a12);
}

@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .col-right,
  .col-left {
    order: 2;
  }

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

  .sidebar {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .main-nav {
    flex-wrap: wrap;
  }

  .search-box {
    justify-content: center;
  }

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

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

.post-page .site-header {
  margin-bottom: 20px;
}

.post-detail {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: visible;
}

.post-body {
  display: grid;
  grid-template-columns: 2.4fr 1fr;
  gap: 28px;
  padding: 28px;
  align-items: start;
}

.post-main {
  line-height: 1.75;
  color: var(--ink);
}

.post-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0;
}

.post-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.post-breadcrumb span:last-child {
  color: var(--ink);
  font-weight: 600;
}

.post-cover {
  height: 320px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  margin-bottom: 18px;
  box-shadow: var(--soft-shadow);
}

.post-title {
  margin: 12px 0 8px;
  font-size: 34px;
}

.post-excerpt {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 18px;
}

.post-content img {
  max-width: 100%;
  border-radius: 12px;
}

.post-sidebar {
  border-left: 1px solid var(--line);
  padding-left: 18px;
  position: sticky;
  top: 110px;
  align-self: start;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.recent-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #d9d6cc;
  background-size: cover;
  background-position: center;
}

.recent-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.post-divider {
  height: 1px;
  background: var(--line);
  margin: 0 28px;
}

.related-posts {
  padding: 22px 28px 28px;
}

.related-posts h3 {
  margin: 0 0 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-card {
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
}

.related-thumb {
  height: 140px;
  background: #d9d6cc;
  background-size: cover;
  background-position: center;
}

.related-body {
  padding: 12px;
}

.related-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.post-missing {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 40px;
  text-align: center;
}

.post-missing .btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .post-body {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    border-left: none;
    padding-left: 0;
    position: static;
  }

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