/* ── VARIABLES ───────────────────────────────────────────── */
:root {
  --green:      #5a9e2f;
  --green-dark: #3d6e20;
  --green-deep: #1a2e0d;
  --gold:       #c8a84b;
  --bg:         #080c06;
  --surface:    #0e1409;
  --text:       #ddeacc;
  --text-muted: #7a9a64;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── GRAIN ───────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPE ────────────────────────────────────────────────── */
/* The display face, declared once on the elements themselves.
 *
 * It used to be set only per component (.ft-card h2, .ft-post-hero h1, and
 * so on). That held together exactly as long as every heading lived inside
 * a component that already existed. The moment home.hbs and the four
 * service templates were added, their headings matched no rule at all and
 * fell through to the body face -- the whole marketing site rendered its
 * headings in DM Sans, and nothing errored or warned.
 *
 * A bare element selector is beaten on specificity by every class rule
 * below, so this changes nothing that is already styled. It only decides
 * what a heading looks like in a template nobody has written yet, which is
 * the case that broke.
 */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}
h1 em, h2 em, h3 em { color: var(--green); font-style: italic; }

/* ── NAVIGATION ──────────────────────────────────────────── */
.ft-nav {
  position: sticky; top: 0; z-index: 1000;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4rem;
  background: rgba(8,12,6,0.88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(90,158,47,0.1);
}
.ft-nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em;
}
.ft-nav-logo span { color: var(--green); }
.ft-nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.ft-nav-links a {
  text-decoration: none; color: var(--text-muted);
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; transition: color 0.2s;
}
.ft-nav-links a:hover,
.ft-nav-links a.current { color: var(--text); }
.ft-nav-cta {
  background: var(--green); color: #fff;
  padding: 0.5rem 1.35rem; border-radius: 2px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.ft-nav-cta:hover { background: var(--green-dark); color: #fff; }

/* The hamburger. Hidden above the breakpoint, where the links are visible
   on their own. The fallbacks in var() keep this file standalone: --border
   and --nav-bg are defined by the cream palette, and figtree.css should not
   depend on a file that loads after it. */
.ft-nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 42px; height: 38px;
  padding: 0;
  background: none;
  border: 1px solid var(--border, rgba(90,158,47,0.25));
  border-radius: 2px;
  color: var(--text);
  cursor: pointer;
}
.ft-nav-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.ft-nav-toggle-bars { position: relative; }
.ft-nav-toggle-bars,
.ft-nav-toggle-bars::before,
.ft-nav-toggle-bars::after {
  content: '';
  display: block;
  width: 18px; height: 2px;
  background: currentColor;
  transition: transform 0.2s, background 0.2s, top 0.2s;
}
.ft-nav-toggle-bars::before { position: absolute; top: -6px; }
.ft-nav-toggle-bars::after  { position: absolute; top: 6px; }

.ft-nav.is-open .ft-nav-toggle-bars { background: transparent; }
.ft-nav.is-open .ft-nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.ft-nav.is-open .ft-nav-toggle-bars::after  { top: 0; transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .ft-nav-toggle-bars,
  .ft-nav-toggle-bars::before,
  .ft-nav-toggle-bars::after { transition: none; }
}

/* ── SHARED ──────────────────────────────────────────────── */
.ft-container { max-width: 1200px; margin: 0 auto; padding: 0 4rem; }
.ft-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1rem;
  font-family: 'Courier Prime', monospace;
}
.ft-label::before { content: '//'; color: var(--green); margin-right: 0.2rem; }

/* ── INDEX PAGE ──────────────────────────────────────────── */
.ft-index-hero {
  padding: 7rem 4rem 5rem;
  background: var(--surface);
  border-bottom: 1px solid rgba(90,158,47,0.08);
  position: relative; overflow: hidden;
}
.ft-index-hero::after {
  content: 'BLOG';
  font-family: 'Playfair Display', serif;
  position: absolute; font-size: 18vw; font-weight: 900;
  color: rgba(90,158,47,0.03); top: 50%; right: -1%;
  transform: translateY(-50%); pointer-events: none; line-height: 1;
}
.ft-index-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem); font-weight: 700;
  line-height: 1.1; color: var(--text); margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.ft-index-hero h1 em { color: var(--green); font-style: italic; }
.ft-index-hero p {
  color: var(--text-muted); font-size: 1rem; line-height: 1.8;
  max-width: 560px; position: relative; z-index: 1;
}

.ft-posts { padding: 5rem 4rem 7rem; background: var(--bg); }
.ft-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-top: 3rem;
}

/* ── POST CARD ───────────────────────────────────────────── */
.ft-card {
  background: var(--surface);
  border: 1px solid rgba(90,158,47,0.1);
  display: flex; flex-direction: column;
  transition: border-color 0.25s, transform 0.25s;
  text-decoration: none;
}
.ft-card:hover { border-color: rgba(90,158,47,0.3); transform: translateY(-3px); }
.ft-card-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  display: block; background: var(--green-deep); flex-shrink: 0;
}
.ft-card-img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--green-deep) 0%, rgba(90,158,47,0.12) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; flex-shrink: 0;
}
.ft-card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.ft-card-meta {
  font-family: 'Courier Prime', monospace;
  font-size: 0.65rem; color: var(--gold);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 0.75rem; display: flex; gap: 1rem; align-items: center;
}
.ft-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); line-height: 1.35; margin-bottom: 0.65rem;
}
.ft-card-excerpt {
  font-size: 0.875rem; color: var(--text-muted);
  line-height: 1.75; margin-bottom: 1rem; flex: 1;
}
.ft-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1rem; }
.ft-tag {
  background: rgba(90,158,47,0.08); border: 1px solid rgba(90,158,47,0.18);
  color: var(--green); padding: 0.15rem 0.5rem; border-radius: 2px;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em;
  font-family: 'Courier Prime', monospace; text-decoration: none;
}
.ft-tag:hover { background: rgba(90,158,47,0.15); color: var(--green); }
.ft-card-link {
  font-size: 0.75rem; color: var(--green); letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.4rem; transition: gap 0.2s;
  margin-top: auto;
}
.ft-card:hover .ft-card-link { gap: 0.7rem; }

/* ── PAGINATION ──────────────────────────────────────────── */
.ft-pagination {
  display: flex; justify-content: center; align-items: center; gap: 1rem;
  padding: 3rem 0 0;
}
.ft-pagination a {
  background: rgba(90,158,47,0.08); border: 1px solid rgba(90,158,47,0.18);
  color: var(--text); padding: 0.6rem 1.4rem; border-radius: 2px;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em;
  text-decoration: none; text-transform: uppercase;
  font-family: 'Courier Prime', monospace; transition: all 0.2s;
}
.ft-pagination a:hover { border-color: var(--green); color: var(--green); }
.ft-pagination-info {
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.06em;
}

/* ── SINGLE POST ─────────────────────────────────────────── */
.ft-post-hero {
  padding: 7rem 4rem 4rem;
  background: var(--surface);
  border-bottom: 1px solid rgba(90,158,47,0.08);
}
.ft-post-hero-inner { max-width: 780px; }
.ft-post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.ft-post-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 700;
  line-height: 1.1; color: var(--text); margin-bottom: 1.25rem;
}
.ft-post-meta {
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
}
.ft-post-meta-dot { width: 3px; height: 3px; background: var(--text-muted); border-radius: 50%; opacity: 0.4; }
.ft-post-excerpt {
  font-size: 1.1rem; color: var(--text-muted); line-height: 1.8;
  margin-top: 1.25rem; max-width: 680px;
  font-style: italic; font-family: 'Playfair Display', serif;
}

.ft-post-feature-img {
  width: 100%; max-height: 520px; object-fit: cover;
  display: block; background: var(--green-deep);
}

/* ── POST BODY ───────────────────────────────────────────── */
.ft-post-content {
  padding: 4rem 4rem 6rem;
  background: var(--bg);
}
.ft-post-body {
  max-width: 740px;
  font-size: 1.05rem; line-height: 1.85; color: var(--text);
}
.ft-post-body h1,
.ft-post-body h2,
.ft-post-body h3,
.ft-post-body h4 {
  font-family: 'Playfair Display', serif; color: var(--text);
  margin: 2.5rem 0 1rem; line-height: 1.2;
}
.ft-post-body h2 { font-size: 1.8rem; }
.ft-post-body h3 { font-size: 1.4rem; }
.ft-post-body h4 { font-size: 1.15rem; color: var(--green); }
.ft-post-body p { margin-bottom: 1.5rem; }
.ft-post-body a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.ft-post-body a:hover { color: var(--green-dark); }
.ft-post-body strong { color: var(--text); font-weight: 600; }
.ft-post-body em { font-style: italic; color: var(--text-muted); }
.ft-post-body ul,
.ft-post-body ol { padding-left: 1.75rem; margin-bottom: 1.5rem; }
.ft-post-body li { margin-bottom: 0.5rem; color: var(--text-muted); }
.ft-post-body li strong { color: var(--text); }
.ft-post-body blockquote {
  border-left: 3px solid var(--green); margin: 2rem 0;
  padding: 1.25rem 1.75rem;
  background: var(--surface);
}
.ft-post-body blockquote p {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 1.1rem; color: var(--text); margin: 0;
}
.ft-post-body code {
  font-family: 'Courier Prime', monospace; font-size: 0.88em;
  background: rgba(90,158,47,0.1); border: 1px solid rgba(90,158,47,0.18);
  color: var(--green); padding: 0.15em 0.45em; border-radius: 2px;
}
.ft-post-body pre {
  background: var(--surface); border: 1px solid rgba(90,158,47,0.12);
  padding: 1.5rem; overflow-x: auto; margin-bottom: 1.5rem;
  border-radius: 2px;
}
.ft-post-body pre code {
  background: none; border: none; padding: 0; color: var(--text-muted);
  font-size: 0.875rem; line-height: 1.7;
}
.ft-post-body img {
  max-width: 100%; height: auto; display: block;
  margin: 2rem auto; border: 1px solid rgba(90,158,47,0.1);
}
.ft-post-body hr {
  border: none; border-top: 1px solid rgba(90,158,47,0.15);
  margin: 3rem 0;
}
.ft-post-body figure { margin: 2rem 0; }
.ft-post-body figcaption {
  font-family: 'Courier Prime', monospace; font-size: 0.7rem;
  color: var(--text-muted); text-align: center; margin-top: 0.75rem;
  letter-spacing: 0.04em;
}
/* Ghost-specific cards */
.kg-card { margin: 2rem 0; }
.kg-width-wide {
  margin-left: calc(50% - 45vw); margin-right: calc(50% - 45vw);
  max-width: 90vw; width: 90vw;
}
.kg-width-full {
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  max-width: 100vw; width: 100vw;
}
.kg-image-card img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.kg-embed-card { display: flex; justify-content: center; }
.kg-callout-card {
  padding: 1.25rem 1.5rem; background: var(--surface);
  border: 1px solid rgba(90,158,47,0.18); border-left: 3px solid var(--green);
  display: flex; gap: 1rem; align-items: flex-start;
}
.kg-callout-text { font-size: 0.95rem; color: var(--text-muted); }
.kg-bookmark-card {
  border: 1px solid rgba(90,158,47,0.18); background: var(--surface);
  padding: 1.25rem; text-decoration: none; display: block; transition: border-color 0.2s;
}
.kg-bookmark-card:hover { border-color: var(--green); }
.kg-bookmark-title { font-family: 'Playfair Display', serif; color: var(--text); margin-bottom: 0.4rem; }
.kg-bookmark-description { font-size: 0.875rem; color: var(--text-muted); }

/* ── POST FOOTER / CTA ───────────────────────────────────── */
.ft-post-cta {
  padding: 5rem 4rem;
  background: var(--green-deep);
  text-align: center;
}
.ft-post-cta h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700;
  color: var(--text); margin-bottom: 0.75rem;
}
.ft-post-cta p { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.975rem; max-width: 480px; margin-left: auto; margin-right: auto; line-height: 1.8; }
.ft-btn {
  display: inline-block;
  background: var(--green); color: #fff;
  padding: 0.85rem 2rem; border-radius: 2px;
  font-size: 0.875rem; font-weight: 600; text-decoration: none;
  letter-spacing: 0.03em; transition: all 0.2s; border: 2px solid var(--green);
  font-family: 'DM Sans', sans-serif;
}
.ft-btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; transform: translateY(-1px); }
.ft-btn-outline {
  background: transparent; color: var(--text);
  border: 2px solid rgba(221,234,204,0.2); margin-left: 1rem;
}
.ft-btn-outline:hover { border-color: var(--green); color: var(--green); }

/* ── TAG / AUTHOR PAGE ───────────────────────────────────── */
.ft-archive-hero {
  padding: 7rem 4rem 4rem; background: var(--surface);
  border-bottom: 1px solid rgba(90,158,47,0.08);
}
.ft-archive-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 700;
  color: var(--text); margin-bottom: 0.75rem;
}
.ft-archive-hero p { color: var(--text-muted); font-size: 0.975rem; line-height: 1.8; max-width: 560px; }

/* ── FOOTER ──────────────────────────────────────────────── */
.ft-footer {
  background: var(--bg); border-top: 1px solid rgba(90,158,47,0.1);
  padding: 2.5rem 4rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-muted); gap: 2rem; flex-wrap: wrap;
}
.ft-footer-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--text); font-weight: 700; text-decoration: none; display: block;
}
.ft-footer-brand-name span { color: var(--green); }
.ft-footer-tag {
  font-family: 'Courier Prime', monospace; font-size: 0.7rem;
  color: var(--text-muted); margin-top: 0.25rem; letter-spacing: 0.04em;
}
.ft-footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.ft-footer-nav a {
  color: var(--text-muted); text-decoration: none; font-size: 0.78rem;
  letter-spacing: 0.04em; transition: color 0.2s;
  text-transform: uppercase;
}
.ft-footer-nav a:hover { color: var(--green); }
.ft-footer-legal { text-align: right; line-height: 1.75; font-size: 0.73rem; }

/* ── 404 / ERROR ─────────────────────────────────────────── */
.ft-error {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  flex-direction: column; text-align: center; padding: 4rem;
}
.ft-error-code {
  font-family: 'Playfair Display', serif; font-size: 8rem; font-weight: 900;
  color: rgba(90,158,47,0.12); line-height: 1; margin-bottom: 1rem;
}
.ft-error h1 {
  font-family: 'Playfair Display', serif; font-size: 2rem;
  color: var(--text); margin-bottom: 0.75rem;
}
.ft-error p { color: var(--text-muted); margin-bottom: 2rem; }

/* ── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .ft-nav { padding: 0 1.25rem; gap: 0.75rem; justify-content: flex-start; }
  .ft-nav-cta { margin-left: auto; }
  .ft-nav-toggle { display: inline-flex; }

  /* The links become a panel hung off the nav. .ft-nav is position:sticky,
     which is a positioned element, so it is the containing block for this.
     display:none when closed is deliberate -- it keeps the links out of the
     accessibility tree and out of tab order, which visibility/opacity would
     not. */
  .ft-nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.25rem 0 0.75rem;
    background: var(--nav-bg, rgba(8,12,6,0.96));
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border, rgba(90,158,47,0.15));
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .ft-nav.is-open .ft-nav-links { display: flex; }
  .ft-nav-links li { display: block; }
  .ft-nav-links a {
    display: block;
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border, rgba(90,158,47,0.12));
  }
  .ft-nav-links li:last-child a { border-bottom: none; }

  .ft-index-hero, .ft-posts, .ft-post-hero,
  .ft-post-content, .ft-post-cta, .ft-archive-hero,
  .ft-footer { padding-left: 1.5rem; padding-right: 1.5rem; }
  .ft-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ft-nav-logo { font-size: 1rem; }
  .ft-nav-cta { padding: 0.45rem 0.9rem; font-size: 0.72rem; }
  .ft-grid { grid-template-columns: 1fr; }
  .ft-footer { flex-direction: column; }
  .ft-footer-legal { text-align: left; }
}
