:root {
  --paper: #fbfaf7;
  --ink: #1d2328;
  --muted: #6a737b;
  --accent: #7b6657;
  --accent-dark: #58463a;
  --line: rgba(29, 35, 40, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

a:hover {
  color: var(--accent);
}

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

.site-header,
.site-body,
.site-footer__inner {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: 0.35rem;
  background: rgba(251, 250, 247, 0.96);
  backdrop-filter: blur(8px);
}

.site-nav {
  padding: 0.85rem 0 0.25rem;
  border-bottom: 1px solid var(--line);
}

.site-nav__utility {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.45rem;
}

.site-nav__external {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav__external:hover,
.site-nav__external:focus {
  color: var(--accent);
}

.site-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav__brand {
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav__brand:hover {
  color: var(--accent-dark);
}

.site-nav__menu {
  flex: 1 1 auto;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.95rem 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.site-nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.site-nav__list a {
  position: relative;
  display: inline-block;
  padding: 0 0 0.35rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 140ms ease;
}

.site-nav__list a:hover::after,
.site-nav__list a:focus::after {
  transform: scaleX(1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-body {
  padding-bottom: 2rem;
}

.site-promo {
  margin-top: 2.5rem;
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 23, 42, 0.03));
}

.site-promo__eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-promo h2 {
  margin: 0 0 0.7rem;
}

.site-promo p {
  margin: 0;
}

.site-promo__copy {
  margin-bottom: 1.25rem;
}

.site-promo__copy + .site-promo__actions {
  margin-top: 1.25rem;
  padding-top: 0.35rem;
}

.site-promo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-top: 0;
}

.site-promo__actions .button-link {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.2;
  white-space: nowrap;
}

.content-column--full {
  width: 100%;
}

.content-column > * + * {
  margin-top: 1.5rem;
}

.archive-head {
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.archive-intro {
  margin-bottom: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.archive-label {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.content-column h1,
.content-column h2,
.content-column h3,
.content-column h4 {
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  line-height: 1.12;
}

.content-column h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.95rem, 4vw, 2.8rem);
}

.content-column h2 {
  margin-top: 1.45rem;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
}

.content-column h3 {
  margin-top: 1.25rem;
  font-size: 1.3rem;
}

.content-column p,
.content-column li {
  font-size: 1.03rem;
}

.content-column ul,
.content-column ol {
  padding-left: 1.3rem;
}

.content-column blockquote {
  margin: 1.4rem 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.content-column pre,
.content-column code {
  font-family: Consolas, "Courier New", monospace;
}

.content-column pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 4px;
  background: #1f2933;
  color: #f8fafc;
}

.story-card + .story-card,
.story-full + .post-nav,
.post-nav + .related-posts {
  margin-top: 2rem;
}

.story-card {
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.story-card--featured {
  display: grid;
  grid-template-columns: minmax(280px, 56%) minmax(0, 44%);
  gap: 0.9rem 1.25rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.story-card--featured .story-card__title {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 0.35rem;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
}

.story-card--featured .story-card__media {
  grid-column: 1;
  grid-row: 2 / span 5;
  margin: 0;
  width: 100%;
}

.story-card--featured .story-card__meta,
.story-card--featured .story-card__tags,
.story-card--featured .story-card__body,
.story-card--featured .story-card__cta {
  grid-column: 2;
}

.story-card--featured .story-card__meta {
  grid-row: 2;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.story-grid .story-card {
  margin-top: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.story-grid .story-card__media {
  width: 100%;
}

.story-grid .story-card__title {
  font-size: 1.35rem;
}

.story-grid .story-card + .story-card {
  margin-top: 0;
}

.story-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.story-card__title {
  margin: 0 0 0.65rem;
}

.story-card__title a {
  color: var(--ink);
  text-decoration: none;
}

.story-card__title a:hover {
  color: var(--accent-dark);
}

.story-card__tags,
.story-full__header .story-card__tags {
  margin-bottom: 0.9rem;
}

.story-card__tags a {
  display: inline-flex;
  align-items: center;
  margin-right: 0.45rem;
  margin-bottom: 0.45rem;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  background: rgba(123, 102, 87, 0.08);
  color: var(--accent-dark);
  font-size: 0.84rem;
  text-decoration: none;
}

.story-card__media,
.story-full__media {
  display: block;
  margin: 0 0 0.9rem;
}

.story-card__media {
  width: min(100%, 360px);
}

.story-card__media img,
.story-full__media img {
  width: 100%;
  border-radius: 4px;
  object-fit: cover;
}

.story-full__media {
  float: left;
  width: min(42%, 360px);
  margin: 0.2rem 1.25rem 0.75rem 0;
}

.story-full__media img {
  width: 100%;
  max-width: 360px;
}

.story-full__body::after {
  content: "";
  display: block;
  clear: both;
}

.story-card__body::after,
.profile-page__about::after {
  content: "";
  display: block;
  clear: both;
}

.story-card__body img,
.story-full__body img,
.profile-page__about img {
  float: left;
  width: min(42%, 320px);
  max-width: 320px;
  margin: 0.2rem 1.25rem 0.9rem 0;
  border-radius: 4px;
}

.story-card__body img.full-size-image,
.story-full__body img.full-size-image,
.profile-page__about img.full-size-image {
  display: block;
  float: none;
  width: 100%;
  max-width: none;
  margin: 0 0 1rem;
}

.story-card__body > :first-child,
.story-full__body > :first-child,
.profile-page__about > :first-child {
  margin-top: 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: none;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover,
.button-link:focus {
  color: var(--accent);
}

.story-full__dek {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-nav__card,
.related-posts,
.empty-state {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.post-nav__card {
  color: var(--ink);
  text-decoration: none;
}

.post-nav__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.related-posts h2,
.empty-state h1 {
  margin-top: 0;
}

.pagination-wrap {
  margin-top: 1.5rem;
}

.pagination-wrap ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-wrap a,
.pagination-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  text-decoration: none;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.copyright p,
.copyright {
  margin: 0;
}

.story-card__body .row,
.story-full__body .row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.story-card__body .col-sm-3,
.story-card__body .col-sm-4,
.story-card__body .col-sm-6,
.story-card__body .col-sm-12,
.story-card__body .col-md-3,
.story-card__body .col-md-4,
.story-card__body .col-md-6,
.story-card__body .col-md-12,
.story-full__body .col-sm-3,
.story-full__body .col-sm-4,
.story-full__body .col-sm-6,
.story-full__body .col-sm-12,
.story-full__body .col-md-3,
.story-full__body .col-md-4,
.story-full__body .col-md-6,
.story-full__body .col-md-12 {
  min-width: 0;
  grid-column: span 12;
}

.story-card__body .col-sm-3,
.story-card__body .col-md-3,
.story-full__body .col-sm-3,
.story-full__body .col-md-3 {
  grid-column: span 3;
}

.story-card__body .col-sm-4,
.story-card__body .col-md-4,
.story-full__body .col-sm-4,
.story-full__body .col-md-4 {
  grid-column: span 4;
}

.story-card__body .col-sm-6,
.story-card__body .col-md-6,
.story-full__body .col-sm-6,
.story-full__body .col-md-6 {
  grid-column: span 6;
}

.story-card__body .col-sm-12,
.story-card__body .col-md-12,
.story-full__body .col-sm-12,
.story-full__body .col-md-12 {
  grid-column: span 12;
}

.story-card__body .row .col-sm-3 > p:first-child,
.story-card__body .row .col-sm-4 > p:first-child,
.story-card__body .row .col-sm-6 > p:first-child,
.story-card__body .row .col-sm-12 > p:first-child,
.story-card__body .row .col-md-3 > p:first-child,
.story-card__body .row .col-md-4 > p:first-child,
.story-card__body .row .col-md-6 > p:first-child,
.story-card__body .row .col-md-12 > p:first-child,
.story-full__body .row .col-sm-3 > p:first-child,
.story-full__body .row .col-sm-4 > p:first-child,
.story-full__body .row .col-sm-6 > p:first-child,
.story-full__body .row .col-sm-12 > p:first-child,
.story-full__body .row .col-md-3 > p:first-child,
.story-full__body .row .col-md-4 > p:first-child,
.story-full__body .row .col-md-6 > p:first-child,
.story-full__body .row .col-md-12 > p:first-child {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.story-card__body .row img,
.story-full__body .row img {
  display: block;
  float: none;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 4px;
}

@media (max-width: 920px) {
  .story-card--featured {
    grid-template-columns: 1fr;
  }

  .story-card--featured .story-card__media {
    grid-column: 1;
    grid-row: auto;
  }

  .story-card--featured .story-card__title,
  .story-card--featured .story-card__meta,
  .story-card--featured .story-card__tags,
  .story-card--featured .story-card__body,
  .story-card--featured .story-card__cta {
    grid-column: 1;
  }

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

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

@media (max-width: 640px) {
  .site-header,
  .site-body,
  .site-footer__inner {
    width: min(100% - 1rem, 980px);
  }

  .site-nav {
    padding-bottom: 0.65rem;
  }

  .site-nav__utility {
    justify-content: flex-start;
    margin-bottom: 0.7rem;
  }

  .site-nav__bar {
    position: relative;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-nav__toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav__menu {
    display: none;
    width: 100%;
    padding-top: 0.7rem;
    flex-basis: 100%;
  }

  .site-nav__menu.is-open {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .site-footer__inner {
    display: block;
  }

  .site-promo {
    padding: 1.2rem 1rem;
  }

  .site-promo__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .story-card__body .row,
  .story-full__body .row {
    grid-template-columns: 1fr;
  }

  .story-full__media {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 1rem;
  }

  .story-full__media img {
    max-width: none;
  }

  .story-card__body img,
  .story-full__body img,
  .profile-page__about img {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 1rem;
  }

  .story-card__body .col-sm-3,
  .story-card__body .col-sm-4,
  .story-card__body .col-sm-6,
  .story-card__body .col-sm-12,
  .story-card__body .col-md-3,
  .story-card__body .col-md-4,
  .story-card__body .col-md-6,
  .story-card__body .col-md-12,
  .story-full__body .col-sm-3,
  .story-full__body .col-sm-4,
  .story-full__body .col-sm-6,
  .story-full__body .col-sm-12,
  .story-full__body .col-md-3,
  .story-full__body .col-md-4,
  .story-full__body .col-md-6,
  .story-full__body .col-md-12 {
    grid-column: span 1;
  }

  .content-column p,
  .content-column li {
    font-size: 1rem;
  }
}
