/* ==========================================================================
   Theme Name: GCF
   Theme URI:  https://www.gcf-framework.com/
   Author:     Billy P (Fitz)
   Author URI: https://www.gcf-framework.com/
   Description: A dark, editorial research-log theme for the GCF / ISAC project. Designed to showcase cognitive-framework writing, code, and architecture diagrams without feeling like a generic tech blog.
   Version:    1.0.0
   License:    MIT
   Text Domain: gcf
   ========================================================================== */

:root {
  --bg:          #0b0e14;
  --bg-2:        #0e1218;
  --surface:     #141821;
  --surface-2:   #1a1f2b;
  --line:        #1f2632;
  --line-soft:   #1a2030;
  --text:        #e6e9ef;
  --text-dim:    #a8b0bd;
  --text-mute:   #6b7484;
  --accent:      #10b981;
  --accent-2:    #34d399;
  --accent-soft: rgba(16, 185, 129, .10);
  --amber:       #f59e0b;
  --sky:         #38bdf8;
  --rose:        #f43f5e;
  --violet:      #a78bfa;
  --cat-ai:      #38bdf8;
  --cat-isac:    #10b981;
  --cat-code:    #a78bfa;
  --cat-theory:  #f59e0b;
  --cat-security:#f43f5e;
  --cat-gcf:     #34d399;
  --radius:      14px;
  --radius-sm:   8px;
  --max:         1180px;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --f-serif:'DM Serif Display', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; color: var(--accent-2); font-family: var(--f-serif); }
code, pre { font-family: var(--f-mono); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, .82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; letter-spacing: .04em; font-size: 15px; }
.brand-sub  { font-size: 11px; color: var(--text-mute); letter-spacing: .02em; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-size: 14px; color: var(--text-dim);
  padding: 8px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-icon { padding: 8px; color: #e6e9ef !important; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.nav-icon:hover { color: var(--accent) !important; background: var(--surface); }
a.nav-icon-github svg, button.nav-icon-github svg { display: block; }
.nav-icon-github:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-icon-github:focus:not(:focus-visible) { outline: none; }
.nav-icon:hover { color: var(--accent); background: var(--surface); }
a.nav-icon-github svg { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s, border-color .15s, color .15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #04130d; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface); border-color: #2c3548; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Hero (front page) ---------- */
.hero {
  position: relative;
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 80% 20%, rgba(16,185,129,.10), transparent 60%),
    radial-gradient(40% 40% at 10% 80%, rgba(56,189,248,.07), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 24px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.hero-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--text);
}
.hero-sub {
  max-width: 660px;
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 36px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 56px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 28px 36px;
  list-style: none; padding: 0; margin: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 24px;
  max-width: 720px;
}
.hero-meta li { display: flex; flex-direction: column; gap: 4px; }
.m-key {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.m-val { font-size: 14px; color: var(--text); }

/* ---------- Kicker ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 18px;
}
.kicker .num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 22px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 500;
}
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Sections ---------- */
section { padding: 96px 0; border-bottom: 1px solid var(--line-soft); }
section h2 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  color: var(--text);
}
section .lede {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 640px;
  margin: 0 0 56px;
}

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.post-card {
  display: flex; flex-direction: column;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s, border-color .2s, background .2s;
  min-height: 240px;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: #2a3346;
  background: var(--surface-2);
}
.post-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-mute);
}
.post-num { color: var(--accent); font-weight: 500; }
.post-cat {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: .04em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  text-transform: uppercase;
}
.cat-ai      { color: var(--cat-ai);      border-color: rgba(56,189,248,.3); }
.cat-isac    { color: var(--cat-isac);    border-color: rgba(16,185,129,.3); }
.cat-code    { color: var(--cat-code);    border-color: rgba(167,139,250,.3); }
.cat-theory  { color: var(--cat-theory);  border-color: rgba(245,158,11,.3); }
.cat-security{ color: var(--cat-security);border-color: rgba(244,63,94,.3); }
.cat-gcf     { color: var(--cat-gcf);     border-color: rgba(52,211,153,.3); }
.post-date { margin-left: auto; }
.post-card h3 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
}
.post-card p {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 24px;
  flex: 1;
}
.post-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-mute);
}
.arrow { transition: transform .15s, color .15s; color: var(--text-mute); }
.post-card:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* ---------- Single post ---------- */
.post {
  padding: 80px 0 96px;
}
.post-header {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}
.post-header .kicker { justify-content: center; }
.post-header h1 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 16px 0 20px;
  color: var(--text);
}
.post-header .dek {
  font-size: 19px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}
.post-body {
  max-width: 700px;
  margin: 0 auto;
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--text);
}
.post-body h2 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  margin: 56px 0 20px;
  color: var(--text);
}
.post-body p { margin: 0 0 24px; color: var(--text-dim); }
.post-body p strong { color: var(--text); font-weight: 600; }
.post-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--f-serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--text);
  font-style: italic;
}
.post-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.post-body code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--amber);
}
.post-body pre code { background: none; padding: 0; color: var(--text); }

.post-footer {
  max-width: 700px;
  margin: 64px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer { padding: 32px 0; background: var(--bg); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-mute);
}
.foot-l { display: flex; align-items: center; gap: 12px; }
.foot-r { display: flex; align-items: center; gap: 10px; }
.foot-r a:hover { color: var(--accent); }

/* ---------- WordPress core ---------- */
.alignwide { max-width: var(--max); margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--text-mute); text-align: center; margin-top: 8px; }
.screen-reader-text {
  position: absolute; clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Dev badges (clickable) ---------- */
.dev-badges {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-mute);
}
.dev-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  letter-spacing: .04em;
  color: var(--text-dim);
  transition: transform .15s, border-color .15s, color .15s, background .15s;
}
.dev-badge:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
}
.dev-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .hero { padding: 56px 0; }
  .post-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .wrap { padding: 0 20px; }
  .post { padding: 48px 0 64px; }
}

/* ==========================================================================
   NEW: status line, filter chips, search, reading progress, code blocks,
   author bio, related posts, path step (start-here)
   ========================================================================== */

.now-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-family: var(--f-mono); font-size: 13px; color: var(--text-dim); }
.now-line .now-label { color: var(--accent); font-weight: 500; }
.now-line .now-text  { color: var(--text-mute); }
.now-line .now-link  { margin-left: auto; color: var(--accent); }
.now-line .now-link:hover { color: var(--accent-2); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-family: var(--f-mono); font-size: 12px; color: var(--text-dim); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: #2a3346; color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .chip-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 5px; background: rgba(255,255,255,.04); border-radius: 8px; font-size: 10px; color: inherit; opacity: .7; }

.search-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 16, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: flex-start; justify-content: center; padding: 80px 20px 20px; opacity: 0; transition: opacity .18s ease; }
.search-overlay.is-open { opacity: 1; }
.search-overlay[hidden] { display: none; }
.search-box { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); transform: translateY(-12px); transition: transform .2s ease; }
.search-overlay.is-open .search-box { transform: translateY(0); }
.search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--text-mute); }
.search-input-wrap input { flex: 1; background: none; border: none; outline: none; font-family: var(--f-sans); font-size: 16px; color: var(--text); }
.search-input-wrap kbd { font-family: var(--f-mono); font-size: 10px; padding: 3px 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; color: var(--text-mute); }
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-hit { display: grid; grid-template-columns: 36px 60px 1fr 16px; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; transition: background .12s; color: var(--text); }
.search-hit:hover { background: var(--surface-2); }
.search-hit-num { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.search-hit-cat { font-family: var(--f-mono); font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; letter-spacing: .04em; }
.search-hit-title { font-size: 14px; color: var(--text); }
.search-hit-arrow { color: var(--text-mute); font-size: 14px; text-align: right; }
.search-empty { padding: 24px; text-align: center; color: var(--text-mute); font-size: 14px; }
.search-foot { padding: 10px 16px; border-top: 1px solid var(--line-soft); font-family: var(--f-mono); font-size: 11px; color: var(--text-mute); text-align: center; }
.search-foot kbd { font-family: var(--f-mono); font-size: 10px; padding: 2px 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; margin: 0 2px; }

.reading-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); width: 0%; z-index: 60; transition: width .05s linear; box-shadow: 0 0 8px var(--accent); }

.code-block { margin: 32px 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-family: var(--f-mono); font-size: 12px; color: var(--text-mute); }
.code-bar .code-lang { text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 500; }
.code-bar .code-name { flex: 1; color: var(--text-dim); font-size: 12px; }
.code-bar .code-copy { background: var(--bg); color: var(--text-dim); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; font-family: var(--f-mono); font-size: 11px; cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.code-bar .code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-bar .code-copy.is-copied { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.code-block pre { margin: 0; padding: 20px 22px; background: transparent; font-family: var(--f-mono); font-size: 13.5px; line-height: 1.7; color: var(--text); overflow-x: auto; }
.code-block code { background: none; padding: 0; color: inherit; font-size: inherit; }
.c-kw { color: #c084fc; } .c-type { color: #38bdf8; } .c-fn { color: #34d399; } .c-str { color: #fbbf24; } .c-num { color: #f472b6; } .c-com { color: #6b7484; font-style: italic; }

.author-bio { padding: 48px 0; border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.author-card { max-width: 700px; margin: 0 auto; display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: center; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.author-avatar { display: flex; }
.author-text .author-name { font-size: 13px; color: var(--text-mute); margin-bottom: 4px; font-family: var(--f-mono); }
.author-text .author-name strong { color: var(--text); }
.author-text p { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.author-text p a { color: var(--accent); }
.share { display: flex; align-items: center; gap: 8px; }
.share-label { font-family: var(--f-mono); font-size: 11px; color: var(--text-mute); margin-right: 4px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); font-family: var(--f-mono); font-size: 13px; transition: color .12s, border-color .12s, background .12s; }
.share-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.related { padding: 64px 0 96px; background: var(--bg-2); }

.path-step { display: grid; grid-template-columns: 80px 1fr; gap: 24px; align-items: start; padding: 32px 0; }
.step-num { font-family: var(--f-serif); font-size: 56px; line-height: 1; color: var(--accent); letter-spacing: -0.02em; }
.path-step .step-body h2 { font-size: 24px; line-height: 1.2; margin: 12px 0 16px; }
.path-step .step-body p { font-size: 16px; color: var(--text-dim); line-height: 1.65; margin: 0 0 20px; }
.path-connector { width: 2px; height: 32px; background: linear-gradient(180deg, var(--accent), transparent); margin-left: 39px; }
.nav-link.is-active { color: var(--accent); }

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .author-card { grid-template-columns: 56px 1fr; }
  .share { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line-soft); }
}
