@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Sans:wght@400;500;700&display=swap');

/* ===== TOKENS ===== */

:root {
  --ink: #1a1a1a;
  --paper: #fcf8ee;
  --lime: #d9e7cf;
  --blue: #6478c8;
  --sage: #8ca083;
  --dark-green: #3a5c42;
  --pink: #d96c99;
  --line: #353535;
}

/* ===== BASE ===== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  background:
    linear-gradient(90deg, rgba(17,17,17,0.08) 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(rgba(17,17,17,0.08) 1px, transparent 1px) 0 0/24px 24px,
    var(--paper);
}

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

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

/* ===== LAYOUT ===== */

.wrap {
  width: min(1180px, calc(100% - 2.2rem));
  margin: 1.1rem auto 0;
  padding-bottom: 3rem;
}

/* ===== HEADER ===== */

.top {
  border: 3px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1rem;
  gap: 1rem;
  box-shadow: 7px 7px 0 var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 9999;
  transition: box-shadow .2s;
  will-change: transform;
}

.top.scrolled {
  box-shadow: 7px 7px 0 var(--line), 0 4px 24px rgba(17,17,17,0.1);
}

.brand {
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: .08em;
  font-size: 1.7rem;
  transition: color .12s;
}

.brand:hover { color: var(--pink); }

/* ===== NAV ===== */

.top nav {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.top nav a {
  border: 2px solid var(--line);
  padding: .35rem .6rem;
  font-weight: 700;
  background: #fff;
  transition: background .12s, color .12s;
}

.top nav a:hover { background: var(--paper); color: var(--ink); }

.top nav a.active {
  background: var(--pink);
  color: #fff;
}

/* ===== HAMBURGER ===== */

.nav-toggle {
  display: none;
  background: var(--lime);
  border: 2px solid var(--line);
  padding: .3rem .55rem;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  font-weight: 700;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}

.nav-toggle:hover {
  background: var(--dark-green);
  color: #fff;
  border-color: var(--dark-green);
}

/* ===== BUTTONS ===== */

.cta { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn {
  border: 2px solid var(--line);
  padding: .5rem .75rem;
  font-weight: 700;
  background: var(--lime);
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
  font-size: inherit;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.btn:hover, .btn:focus-visible {
  background: var(--dark-green);
  color: #fff;
  border-color: var(--dark-green);
  outline: none;
  transform: translateY(-1px);
}

.btn.alt { background: #fff; }

.btn.alt:hover, .btn.alt:focus-visible {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ===== SECTIONS ===== */

.section,
.page-head,
footer {
  margin-top: 1rem;
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 var(--line);
  background: #fff;
  padding: 2rem;
  position: relative;
  z-index: 0;
}

.page-head {
  background: linear-gradient(145deg, #fff 0%, #f6f1e3 100%);
}

/* ===== TAGS ===== */

.tag {
  display: inline-block;
  font-weight: 700;
  border: 2px solid var(--line);
  background: var(--pink);
  color: #fff;
  padding: .35rem .55rem;
  font-size: .78rem;
  letter-spacing: .04em;
}

/* ===== TYPOGRAPHY ===== */

h1, h2 {
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: .015em;
  margin: .7rem 0;
  line-height: .94;
}

h3 {
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: .01em;
  margin: 0 0 .4rem;
}

h1 { font-size: clamp(2.4rem, 8vw, 5.2rem); }
h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); margin-top: 0; }
h3 { font-size: 1.15rem; }

p { line-height: 1.5; margin: .6rem 0; }

/* ===== CARDS ===== */

.card {
  border: 2px solid var(--line);
  padding: .85rem;
  background: linear-gradient(140deg, #ffffff 0%, #f6f1e3 100%);
  transition: transform .15s, box-shadow .15s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 7px 7px 0 var(--line);
}

/* ===== POST GRID ===== */

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

/* ===== POST CARD ===== */

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card-title a {
  position: relative;
  z-index: 2;
}

.post-card-img-link { display: block; overflow: hidden; margin: -.85rem -.85rem .75rem; }

.post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.post-card:hover .post-card-img { transform: scale(1.02); }

.post-card-body { display: flex; flex-direction: column; flex: 1; }

.post-card-tag { margin-bottom: .5rem; }

.post-card-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.05rem;
  letter-spacing: .01em;
  margin: 0 0 .4rem;
  line-height: 1.2;
}

.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--pink); }

.post-card-excerpt {
  font-size: .88rem;
  color: #444;
  line-height: 1.45;
  margin: 0 0 .75rem;
  flex: 1;
}

.post-card-meta {
  display: flex;
  gap: .75rem;
  font-size: .78rem;
  font-weight: 700;
  color: #777;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px dashed var(--line);
}

/* ===== POST HEADER ===== */

.post-back {
  display: inline-block;
  margin-bottom: .6rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  border: 2px solid var(--line);
  background: var(--pink);
  color: #fff;
  padding: .35rem .55rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .88rem;
  color: #555;
  margin-top: .75rem;
}

.post-meta-sep { color: #bbb; }

/* ===== POST FEATURE IMAGE ===== */

.post-feature-img {
  padding: 0;
  overflow: hidden;
}

.post-feature-img img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.post-feature-img figcaption {
  font-size: .82rem;
  color: #666;
  padding: .5rem .85rem;
  font-style: italic;
}

/* ===== POST CONTENT ===== */

.post-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #111111;
}

.post-content h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 1.75rem 0 .6rem;
  line-height: 1.1;
}

.post-content h3 {
  font-size: 1.2rem;
  margin: 1.4rem 0 .5rem;
}

.post-content h4 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1rem;
  margin: 1.2rem 0 .4rem;
}

.post-content p { margin: 0 0 1rem; }

.post-content ul, .post-content ol {
  padding-left: 1.6rem;
  margin: .75rem 0 1rem;
}

.post-content li { margin-bottom: .4rem; line-height: 1.55; }

.post-content blockquote {
  border-left: 5px solid var(--blue);
  margin: 1.25rem 0;
  padding: .75rem 1rem;
  background: #f6f1e3;
  font-style: italic;
  color: #333;
}

.post-content blockquote p { margin: 0; }

.post-content a {
  color: inherit;
  text-decoration: none;
  transition: color .12s;
}

.post-content a:hover, .post-content a:active { color: var(--pink); }

.post-content hr {
  border: none;
  border-top: 3px solid var(--line);
  margin: 2rem 0;
}

.post-content figure { margin: 1.25rem 0; }

.post-content figure img {
  border: 2px solid var(--line);
}

.post-content figcaption {
  font-size: .82rem;
  color: #666;
  margin-top: .4rem;
  font-style: italic;
}

/* ===== CODE ===== */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .85em;
  background: #f0ece0;
  border: 1px solid #d8d0c0;
  padding: .1em .3em;
  border-radius: 2px;
}

pre {
  margin: 1rem 0;
  padding: 1rem;
  border: 2px solid var(--line);
  background: var(--ink);
  color: #fff;
  overflow-x: auto;
  box-shadow: 5px 5px 0 var(--line);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .82rem;
  color: inherit;
}

/* ===== POST TAGS ===== */

.post-tags {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.post-tags-label {
  font-weight: 700;
  font-size: .88rem;
}

.post-tag { font-size: .75rem; }
.post-tag:hover { background: var(--dark-green); border-color: var(--dark-green); }

/* ===== PAGINATION ===== */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  gap: .5rem;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: .88rem;
}

.pagination .newer-posts,
.pagination .older-posts {
  border: 2px solid var(--line);
  padding: .45rem .75rem;
  background: #fff;
  transition: background .12s;
}

.pagination .newer-posts:hover,
.pagination .older-posts:hover { background: var(--paper); }

.pagination .page-number { color: #666; }

/* ===== CTA STRIP ===== */

.cta-strip {
  margin-top: 1rem;
  border: 3px solid var(--line);
  background: var(--lime);
  box-shadow: 10px 10px 0 var(--line);
  padding: 1.5rem 1.2rem;
}

.cta-strip .btn { background: #fff; }
.cta-strip .btn:hover { background: var(--dark-green); color: #fff; border-color: var(--dark-green); }

/* ===== FOOTER ===== */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

footer strong, footer strong a {
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: .08em;
  font-size: 1rem;
  text-transform: uppercase;
}

.footer-nav {
  display: flex;
  gap: .35rem 1.25rem;
  flex-wrap: wrap;
  margin-top: 0;
}

.footer-nav a {
  font-size: .85rem;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: border-color .12s;
}

.footer-nav a:hover { border-bottom-color: var(--ink); }

.kicker { font-size: .86rem; }

/* ===== SCROLL REVEAL ===== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== KG WIDTH CLASSES (required by Ghost validator) ===== */

.kg-width-wide {
  width: calc(100% + 4rem);
  margin-left: -2rem;
}

.kg-width-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* ===== GH CONTENT (Ghost-generated markup) ===== */

.gh-content .kg-card { margin: 1.5rem 0; }

.gh-content .kg-image-card img {
  border: 2px solid var(--line);
  width: 100%;
}

.gh-content .kg-width-wide {
  width: calc(100% + 4rem);
  margin-left: -2rem;
}

.gh-content .kg-gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .5rem;
}

.gh-content .kg-gallery-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 2px solid var(--line);
}

.gh-content .kg-bookmark-card {
  border: 2px solid var(--line);
  background: linear-gradient(140deg, #fff 0%, #f6f1e3 100%);
  display: flex;
  overflow: hidden;
}

.gh-content .kg-bookmark-content { padding: .75rem 1rem; flex: 1; }
.gh-content .kg-bookmark-title { font-weight: 700; margin-bottom: .25rem; }
.gh-content .kg-bookmark-description { font-size: .85rem; color: #555; }
.gh-content .kg-bookmark-url { font-size: .78rem; color: #888; margin-top: .35rem; }
.gh-content .kg-bookmark-thumbnail { width: 180px; flex-shrink: 0; }
.gh-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.gh-content .kg-callout-card {
  display: flex;
  gap: .75rem;
  border: 2px solid var(--line);
  background: #f6f1e3;
  padding: 1rem;
}

.gh-content .kg-callout-emoji { font-size: 1.5rem; line-height: 1; }

.gh-content .kg-toggle-card {
  border: 2px solid var(--line);
  background: #fff;
}

.gh-content .kg-toggle-heading-text {
  font-family: 'Archivo Black', sans-serif;
  padding: .75rem 1rem;
  cursor: pointer;
}

.gh-content .kg-toggle-content { padding: 0 1rem .75rem; }

.gh-content .kg-video-card video { width: 100%; border: 2px solid var(--line); }

.gh-content .kg-button-card { text-align: center; margin: 1.5rem 0; }

.gh-content .kg-button-card a {
  display: inline-block;
  border: 2px solid var(--line);
  padding: .55rem 1.25rem;
  font-weight: 700;
  background: var(--lime);
  transition: background .15s, color .15s;
}

.gh-content .kg-button-card a:hover {
  background: var(--dark-green);
  color: #fff;
  border-color: var(--dark-green);
}

/* ===== RESPONSIVE ===== */

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

@media (max-width: 680px) {
  .nav-toggle { display: block; }

  .top nav {
    display: none;
    width: 100%;
    flex-direction: column;
    order: 10;
  }

  .top nav.open { display: flex; }
  .top nav a { padding: .55rem .7rem; }

  .top .header-cta { display: none; }
  .top .header-cta.nav-open { display: flex; width: 100%; order: 11; }

  .top { top: .5rem; }

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

  .wrap { width: min(1180px, calc(100% - 1rem)); }

  .section,
  .page-head,
  footer { box-shadow: 5px 5px 0 var(--line); padding: .9rem; }

  .gh-content .kg-width-wide { width: 100%; margin-left: 0; }

  .post-meta { font-size: .82rem; }
}
