/*
Theme Name:  Fortgale Blog
Theme URI:   https://fortgale.com/blog/
Description: Brand-aligned child theme for the Fortgale blog. Child of GeneratePress.
             Mirrors the Astro site design tokens (../website/src/styles/tokens.css)
             so /blog/ feels continuous with fortgale.com. English-only.
Author:      Fortgale
Author URI:  https://fortgale.com/
Template:    generatepress
Version:     0.12.0
License:     Proprietary
Text Domain: fortgale
*/

/* ===========================================================================
   Design tokens — MIRROR of ../website/src/styles/tokens.css (Brand Identity v1.1).
   ========================================================================= */
:root {
  /* Dark surfaces */
  --bg-void:        #001B3B;   /* navy base (was near-black #02040A) */
  --bg-deep:        #050A1C;
  --bg-panel:       rgba(8, 14, 32, 0.72);
  --bg-panel-solid: #07122A;
  --surface-rgb:    0, 27, 59;
  --ink-on-accent:  #02040A;   /* near-black text on bright cyan/blue accents */
  --line:           rgba(120, 180, 255, 0.14);
  --line-strong:    rgba(120, 180, 255, 0.28);
  --ink:            #E6F0FF;
  --ink-dim:        #8FA6C9;
  --ink-mute:       #5A7099;

  /* Light surfaces */
  --bg-light:       #ECECEF;
  --bg-light-2:     #E2E2E6;
  --card-light:     #FFFFFF;
  --ink-light:      #0F1117;
  --ink-body:       #4B5563;

  /* Accent · il blu Fortgale */
  --blue:           #00A3FF;
  --blue-elec:      #22D3FF;
  --blue-hot:       #0066FF;
  --accent-dark:    #0369A1;

  /* Signal */
  --violet:         #8B5CF6;
  --magenta:        #C026D3;
  --red-alert:      #FF2E5C;
  --amber:          #FFB020;
  --ok:             #10B981;

  /* Effects */
  --glow-blue: 0 0 24px rgba(34, 211, 255, 0.38), 0 0 48px rgba(0, 163, 255, 0.18);

  /* Fonts */
  --ff-display: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ff-serif:   'IBM Plex Serif', Georgia, 'Times New Roman', serif;

  /* ---- Structural surfaces (mirror Astro nav/footer, not brand accents) --- */
  --fg-bar-navy:     #001B3B;
  --fg-footer-top:   #0A1024;
  --fg-footer-bot:   #1F2330;
  --fg-footer-text:  #B7BEC9;
  --fg-muted-light:  #6B7280;   /* muted text on light surfaces */
  --fg-line-light:   rgba(0, 40, 90, 0.12);
  --fg-line-accent:  rgba(3, 105, 161, 0.22);

  --fg-bar-h: 64px;
  --fg-maxw:  1080px;
}

@media (max-width: 860px) {
  :root { --fg-bar-h: 56px; }
}

/* ===========================================================================
   Base
   ========================================================================= */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--fg-bar-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;              /* no horizontal scroll; clip (not hidden) keeps position:sticky working */
}

a { color: var(--blue-elec); text-decoration: none; }
a:hover { color: var(--blue); }

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

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

::selection { background: var(--blue-elec); color: var(--ink-on-accent); }

:focus-visible { outline: 2px solid var(--blue-elec); outline-offset: 2px; }

.fg-skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: 10px 16px; background: var(--bg-panel-solid); color: var(--blue-elec);
  font-family: var(--ff-mono); border: 1px solid var(--line-strong);
}
.fg-skip:focus { left: 12px; top: 12px; }

.fg-main { padding-top: calc(var(--fg-bar-h) + 32px); }

.fg-container { max-width: var(--fg-maxw); margin: 0 auto; padding: 0 24px 72px; }

.fg-sep { color: var(--line-strong); padding: 0 2px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===========================================================================
   Reading-progress bar (single only) — cyber accent
   ========================================================================= */
.fg-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 101;
  background: rgba(34, 211, 255, 0.08); pointer-events: none;
}
.fg-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue-hot), var(--blue-elec));
  box-shadow: 0 0 10px rgba(34, 211, 255, 0.6);
}

/* ===========================================================================
   Brand bar — glass, fixed top
   ========================================================================= */
.fg-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--fg-bar-h);
  background: linear-gradient(180deg, rgba(0,27,59,0.82) 0%, rgba(0,27,59,0.6) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(34, 211, 255, 0.18);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
}
/* Scrolled state — solid navy so the bar/CTA look identical over dark (home) and white (articles). */
.fg-bar--solid {
  background: var(--fg-bar-navy);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom-color: rgba(34, 211, 255, 0.22);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}
.fg-bar-inner {
  max-width: var(--fg-maxw); height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.fg-logo { display: flex; align-items: center; line-height: 0; flex-shrink: 0; }
.fg-logo img { height: 30px; width: auto; display: block; }

.fg-nav { display: flex; align-items: center; gap: 26px; font-family: var(--ff-display); font-size: 14px; }
.fg-nav-link { position: relative; color: var(--ink-dim); padding: 6px 0; transition: color 0.2s; }
.fg-nav-link:hover { color: var(--blue-elec); }
.fg-nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--blue-elec); box-shadow: 0 0 4px var(--blue-elec);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fg-nav-link:hover::after { transform: scaleX(1); }
.fg-nav-current { color: var(--blue-elec); cursor: default; }
.fg-nav-current::after { transform: scaleX(1); }

.fg-cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 18px; flex: 0 0 auto;
  border: 1px solid var(--blue-elec); color: var(--blue-elec);
  font-family: var(--ff-display); font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: rgba(34, 211, 255, 0.04);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.fg-cta:hover { background: rgba(34, 211, 255, 0.10); box-shadow: var(--glow-blue); color: var(--blue-elec); }

.fg-burger {
  display: none; width: 42px; height: 42px; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: none; border: 1px solid var(--line-strong); cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: border-color 0.2s, background 0.2s;
}
.fg-burger:hover { border-color: var(--blue-elec); background: rgba(34,211,255,0.06); }
.fg-burger span { display: block; width: 18px; height: 1.5px; background: var(--ink); }

@media (max-width: 1024px) {
  .fg-bar-inner { padding: 0 18px; }
  .fg-burger { display: flex; }
  .fg-nav {
    position: absolute; top: var(--fg-bar-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px 18px 20px; background: var(--fg-bar-navy);
    border-bottom: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(2,4,10,0.6);
    display: none;
  }
  .fg-nav.is-open { display: flex; }
  .fg-nav-link { padding: 15px 0; border-bottom: 1px dashed var(--line); }
  .fg-nav-link::after { display: none; }
  .fg-cta { margin-top: 14px; align-self: flex-start; height: 44px; padding: 0 20px; }
}

/* ===========================================================================
   Home hero — FULL-PAGE sticky stage + scroll-reveal contact card + dynamic
   cyberpunk effects (drifting grid, title glitch, scanline, mouse parallax).
   ========================================================================= */
.fg-hero {
  position: relative; background: var(--bg-void);
  margin-top: calc(-1 * (var(--fg-bar-h) + 32px));
  height: 150vh;                       /* tall → stage pins while the card reveals */
}
.fg-hero-stage {
  position: sticky; top: 0;
  height: 100vh;                       /* FULL PAGE */
  overflow: hidden;
  display: flex; align-items: center;
  padding: calc(var(--fg-bar-h) + 48px) 0 84px;
}
.fg-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image: var(--fg-hero-img);
  background-position: center right; background-size: cover; background-repeat: no-repeat;
  background-color: var(--ink-on-accent);
  transform: scale(1.06); will-change: transform;
}
.fg-hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,27,59,.96) 0%, rgba(0,27,59,.82) 35%, rgba(0,27,59,.4) 65%, rgba(0,27,59,.2) 100%),
    linear-gradient(180deg, rgba(0,27,59,.5) 0%, transparent 25%, transparent 65%, rgba(0,27,59,.95) 100%);
}
.fg-hero-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(34,211,255,.02) 3px, rgba(34,211,255,.02) 4px);
}

/* dynamic drifting grid */
.fg-hero-fx {
  position: absolute; inset: -2px; z-index: 1; pointer-events: none; opacity: .55;
  background-image:
    linear-gradient(rgba(34,211,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,255,.07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 72% 42%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 60% at 72% 42%, #000 25%, transparent 80%);
  animation: fgGridDrift 6s linear infinite; will-change: transform, background-position;
}
@keyframes fgGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 46px 46px, 46px 46px; } }

.fg-hero-scan {
  position: absolute; top: 0; left: 0; right: 0; height: 140px; z-index: 2;
  pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(180deg, transparent, rgba(34,211,255,.07) 50%, transparent);
  animation: fgScan 11s linear infinite;
}
@keyframes fgScan { 0% { transform: translateY(-140px); } 100% { transform: translateY(100vh); } }

.fg-hero-inner { position: relative; z-index: 3; width: 100%; max-width: var(--fg-maxw); margin: 0 auto; padding: 0 24px; }

.fg-tagbar {
  display: inline-flex; align-items: center; gap: 12px; padding: 7px 14px; margin-bottom: 22px;
  border: 1px solid rgba(34,211,255,.3); background: rgba(34,211,255,.06);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-elec);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.fg-tagbar-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-elec); box-shadow: 0 0 10px var(--blue-elec); animation: fgDot 1.6s ease-in-out infinite; flex-shrink: 0; }
@keyframes fgDot { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

.fg-hero-title {
  font-family: var(--ff-display); font-weight: 500;
  font-size: clamp(32px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -.025em;
  margin: 0 0 18px; color: var(--ink);
}
.fg-hero-title .l1 { display: block; font-weight: 300; color: var(--ink); }
.fg-hero-title .l2 {
  display: block; position: relative; font-weight: 600; color: var(--blue-elec);
  text-shadow: 0 0 22px rgba(34,211,255,.4), 0 0 50px rgba(0,163,255,.2);
}
/* occasional RGB-split glitch */
.fg-hero-title .l2::before,
.fg-hero-title .l2::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  pointer-events: none; overflow: hidden;
}
.fg-hero-title .l2::before { color: var(--magenta); clip-path: inset(100% 0 0 0); animation: fgGlitchA 4.2s steps(1) infinite; }
.fg-hero-title .l2::after  { color: var(--blue);    clip-path: inset(100% 0 0 0); animation: fgGlitchB 5.1s steps(1) infinite; }
@keyframes fgGlitchA {
  0%, 95%, 100% { clip-path: inset(100% 0 0 0); transform: translate(0, 0); }
  96% { clip-path: inset(8% 0 62% 0); transform: translate(-3px, 0); }
  98% { clip-path: inset(45% 0 28% 0); transform: translate(2px, 0); }
}
@keyframes fgGlitchB {
  0%, 93%, 100% { clip-path: inset(100% 0 0 0); transform: translate(0, 0); }
  94% { clip-path: inset(70% 0 8% 0); transform: translate(3px, 0); }
  97% { clip-path: inset(25% 0 55% 0); transform: translate(-2px, 0); }
}

.fg-hero-subcopy {
  font-family: var(--ff-serif); font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45;
  color: var(--ink-dim); max-width: 560px; margin: 0 0 28px; font-weight: 400;
}
.fg-hero-subcopy strong { font-family: var(--ff-display); font-style: normal; font-weight: 600; color: var(--blue-elec); }

/* request-info card — revealed on scroll (parallax) */
.fg-hero-info {
  max-width: 560px; padding: 18px 22px;
  border: 1px solid var(--line-strong); background: rgba(8, 14, 32, 0.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(2,4,10,.5), inset 0 0 0 1px rgba(34,211,255,.05);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.fg-hero-info p { color: var(--ink-dim); margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; }
.fg-hero-info-label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--blue-elec); margin-right: 6px; }
.fg-hero-info-actions { display: flex; gap: 12px; flex-wrap: wrap; }

[data-hero-reveal] {
  opacity: 0; transform: translateY(26px); filter: blur(3px);
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1), filter .9s;
  will-change: opacity, transform;
}
[data-hero-reveal].is-on { opacity: 1; transform: none; filter: none; }

/* scroll cue */
.fg-hero-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 3;
  font-family: var(--ff-mono); font-size: 12.5px; letter-spacing: .3em; text-transform: uppercase; font-weight: 600;
  color: var(--blue-elec); text-shadow: 0 0 12px rgba(34, 211, 255, 0.55);
  transition: opacity .4s;
}
.fg-hero-cue::after { content: ""; width: 2px; height: 38px; background: linear-gradient(var(--blue-elec), transparent); box-shadow: 0 0 8px rgba(34, 211, 255, 0.55); animation: fgCue 1.8s ease-in-out infinite; }
.fg-hero-cue.is-hidden { opacity: 0; pointer-events: none; }
@keyframes fgCue { 0% { transform: scaleY(0); transform-origin: top; opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); transform-origin: top; opacity: 0; } }

@media (max-width: 720px) {
  .fg-hero { height: auto; }
  .fg-hero-stage {
    position: relative; height: auto;
    min-height: 100vh; min-height: 100svh;
    padding: calc(var(--fg-bar-h) + 36px) 0 56px;
  }
  .fg-hero-bg { background-position: center center; transform: none; }
  .fg-hero-info { max-width: none; }
  [data-hero-reveal] { opacity: 1; transform: none; filter: none; }
  .fg-hero-cue { display: none; }
}

/* ===========================================================================
   Posts index (index.php)
   ========================================================================= */
.fg-page-head { padding: 8px 0 36px; border-bottom: 1px dashed var(--line); margin-bottom: 40px; }
.fg-kicker { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue-elec); margin: 0 0 10px; }
.fg-page-title { font-size: clamp(28px, 4vw, 44px); margin: 0; }

.fg-post-list { display: flex; flex-direction: column; gap: 28px; }
.fg-card {
  padding: 26px 28px; background: var(--bg-panel); border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.fg-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 18px 40px rgba(2,4,10,0.5); }
.fg-card-meta { font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink-mute); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fg-card-cats a { color: var(--ink-dim); }
.fg-card-cats a:hover { color: var(--blue-elec); }
.fg-card-title { font-size: 23px; margin: 0 0 12px; }
.fg-card-title a { color: var(--ink); transition: color 0.2s; }
.fg-card-title a:hover { color: var(--blue-elec); }
.fg-card-excerpt { color: var(--ink-dim); font-size: 15px; }
.fg-card-excerpt p { margin: 0 0 10px; }
.fg-readmore { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--ff-mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-elec); }
.fg-readmore:hover { gap: 10px; }

.fg-pagination { margin-top: 44px; font-family: var(--ff-mono); font-size: 13px; }
.fg-pagination a, .fg-pagination .current { padding: 6px 10px; border: 1px solid var(--line); color: var(--ink-dim); margin-right: 6px; display: inline-block; }
.fg-pagination a:hover { border-color: var(--blue-elec); color: var(--blue-elec); }
.fg-pagination .current { border-color: var(--blue-elec); color: var(--blue-elec); }

.fg-card-thumb { display: block; }
.fg-card-thumb img { width: 100%; display: block; border-bottom: 1px solid var(--line); }
.fg-card:has(.fg-card-thumb) { padding: 0; overflow: hidden; }
.fg-card:has(.fg-card-thumb) .fg-card-body { padding: 24px 28px; }
@media (min-width: 720px) {
  .fg-card:has(.fg-card-thumb) { display: grid; grid-template-columns: 240px 1fr; align-items: stretch; }
  .fg-card:has(.fg-card-thumb) .fg-card-thumb img { height: 100%; object-fit: cover; border-bottom: 0; border-right: 1px solid var(--line); }
}

.fg-archive-desc { color: var(--ink-dim); margin-top: 14px; max-width: 60ch; }
.fg-404 { text-align: center; padding-top: 40px; }
.fg-404 .fg-searchform { margin-left: auto; margin-right: auto; }

/* ===========================================================================
   SINGLE POST — dark cyber header band + full-white reading body + sidebar
   ========================================================================= */
.fg-single { /* page bg stays dark behind the dark header + dark footer */ }

/* ---- Dark header band (top + title kept dark · cyberpunk treatment) ------ */
.fg-single-hero {
  position: relative; overflow: hidden;
  margin-top: calc(-1 * (var(--fg-bar-h) + 32px));
  padding: calc(var(--fg-bar-h) + 40px) 0 38px;
  background:
    radial-gradient(1200px 480px at 78% -20%, rgba(34,211,255,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 100%);
}
.fg-single-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.7;
  background-image:
    linear-gradient(rgba(34,211,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,255,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  animation: fgGridDrift 7s linear infinite;
}
.fg-single-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-elec), transparent);
  box-shadow: 0 0 12px rgba(34, 211, 255, 0.4);
}
.fg-single-hero-inner { position: relative; z-index: 1; max-width: var(--fg-maxw); margin: 0 auto; padding: 0 24px; }
.fg-single-title { font-size: clamp(30px, 5vw, 50px); line-height: 1.08; margin: 14px 0 18px; color: var(--ink); text-shadow: 0 0 30px rgba(34,211,255,.16); }
.fg-single-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--ff-mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-mute); }
.fg-single-meta a { color: var(--ink-dim); }
.fg-single-meta a:hover { color: var(--blue-elec); }
.fg-meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-elec); box-shadow: 0 0 8px var(--blue-elec); flex-shrink: 0; }
.fg-single-hero .fg-kicker a { color: var(--blue-elec); }

/* dynamic cyberpunk effects on the dark title band */
.fg-single-hero-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 130px; z-index: 0;
  pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(180deg, transparent, rgba(34,211,255,.08) 50%, transparent);
  animation: fgScanBand 8s linear infinite;
}
@keyframes fgScanBand {
  0%   { transform: translateY(-130px); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(420px); opacity: 0; }
}
.fg-single-title { position: relative; }
.fg-single-title::before,
.fg-single-title::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  pointer-events: none; overflow: hidden;
}
.fg-single-title::before { color: var(--magenta); clip-path: inset(100% 0 0 0); animation: fgGlitchA 5s steps(1) infinite; }
.fg-single-title::after  { color: var(--blue);    clip-path: inset(100% 0 0 0); animation: fgGlitchB 6.2s steps(1) infinite; }

/* ---- White reading body (full-bleed band) -------------------------------- */
.fg-single-body { background: var(--card-light); padding: 52px 0 64px; }
.fg-single-grid {
  max-width: var(--fg-maxw); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start;
}
.fg-single-main { min-width: 0; }
.fg-single-main > .fg-single-media { margin: 0 0 28px; }
.fg-single-main > .fg-report,
.fg-single-main > .fg-postnav,
.fg-single-main > .fg-comments { margin-top: 40px; }

.fg-single-media img {
  width: 100%; display: block; border: 1px solid var(--fg-line-light);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

/* ---- Article body · DARK TEXT ON WHITE ----------------------------------- */
.fg-content { font-size: 17px; line-height: 1.78; color: var(--ink-body); }
.fg-content > * { margin-top: 0; margin-bottom: 1.4em; }
.fg-content h2 { color: var(--ink-light); font-size: 28px; margin-top: 1.8em; margin-bottom: 0.55em; }
.fg-content h3 { color: var(--ink-light); font-size: 22px; margin-top: 1.6em; margin-bottom: 0.5em; }
.fg-content h4 { color: var(--ink-light); font-size: 18px; margin-top: 1.4em; margin-bottom: 0.5em; }
.fg-content a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(3,105,161,.4); }
.fg-content a:hover { color: var(--blue-hot); text-decoration-color: var(--blue-hot); }
.fg-content strong { color: var(--ink-light); }
.fg-content ul, .fg-content ol { padding-left: 1.4em; }
.fg-content li { margin-bottom: 0.5em; }
.fg-content img { height: auto; border: 1px solid var(--fg-line-light); }
.fg-content figure { margin: 1.6em 0; }
.fg-content figcaption { font-family: var(--ff-mono); font-size: 12px; color: var(--fg-muted-light); margin-top: 8px; text-align: center; }
.fg-content blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent-dark);
  font-family: var(--ff-serif); font-style: italic; font-size: 19px; color: var(--ink-body);
}
.fg-content blockquote p:last-child { margin-bottom: 0; }
.fg-content code, .fg-content kbd {
  font-family: var(--ff-mono); font-size: 0.88em;
  background: rgba(3,105,161,.08); border: 1px solid rgba(3,105,161,.2); color: var(--accent-dark);
  padding: 1px 6px; border-radius: 3px;
}
/* Code blocks stay DARK (terminal look) on the white page */
.fg-content pre {
  position: relative;
  font-family: var(--ff-mono); font-size: 13.5px; line-height: 1.6;
  background: var(--bg-panel-solid); border: 1px solid var(--line-strong);
  padding: 18px 20px; overflow: auto; color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.fg-content pre code { background: none; border: 0; padding: 0; color: var(--ink); }
.fg-content hr { border: 0; height: 0; border-top: 1px dashed rgba(0,40,90,.18); margin: 2.4em 0; }
.fg-content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fg-content th, .fg-content td { padding: 10px 14px; border: 1px solid var(--fg-line-light); text-align: left; }
.fg-content thead th { background: rgba(3,105,161,.06); color: var(--accent-dark); font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.fg-content .wp-block-image img { width: 100%; }
.fg-content .alignwide { margin-left: 0; margin-right: 0; max-width: 100%; }
.fg-link-pages { font-family: var(--ff-mono); font-size: 13px; margin-top: 1.6em; }
.fg-link-pages a { padding: 4px 10px; border: 1px solid var(--fg-line-light); margin: 0 4px; color: var(--accent-dark); }

/* Copy button on code blocks */
.fg-copy {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue-elec); background: rgba(34,211,255,.08); border: 1px solid var(--line-strong);
  padding: 3px 9px; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s, color .2s;
}
.fg-content pre:hover .fg-copy, .fg-copy:focus-visible { opacity: 1; }
.fg-copy:hover { background: rgba(34,211,255,.16); }
.fg-copy.is-done { color: var(--ok); border-color: var(--ok); opacity: 1; }
@media (hover: none) { .fg-copy { opacity: 1; } }

/* ---- Tags (light) -------------------------------------------------------- */
.fg-tags-wrap { margin-top: 36px; padding-top: 24px; border-top: 1px dashed rgba(0,40,90,.14); }
.fg-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fg-tags li { margin: 0; }
.fg-tags a {
  display: inline-block; font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink-body); padding: 5px 12px; border: 1px solid rgba(0,40,90,.18);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.fg-tags a::before { content: "#"; color: var(--accent-dark); margin-right: 2px; }
.fg-tags a:hover { color: var(--accent-dark); border-color: var(--accent-dark); background: rgba(3,105,161,.05); }

/* ---- Author box (light) -------------------------------------------------- */
.fg-author {
  display: flex; gap: 18px; align-items: flex-start; margin-top: 40px; padding: 24px 26px;
  background: var(--bg-light); border: 1px solid var(--fg-line-light);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.fg-author-avatar img { width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(0,40,90,.2); display: block; }
.fg-author-label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-dark); }
.fg-author-name { font-size: 18px; margin: 4px 0 8px; color: var(--ink-light); }
.fg-author-bio { color: var(--ink-body); font-size: 14px; margin: 0; }

/* ---- Report / dossier CTA card (stays DARK — accent on white) ------------ */
.fg-report {
  position: relative; overflow: hidden; padding: 32px 34px;
  background: var(--bg-panel-solid); border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.fg-report-scan { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; background: repeating-linear-gradient(0deg, rgba(34, 211, 255, 0.045) 0 1px, transparent 1px 3px); }
.fg-report-tag { position: relative; display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue-elec); margin-bottom: 14px; }
.fg-report-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-elec); box-shadow: 0 0 0 0 rgba(34, 211, 255, 0.6); animation: fgPulse 1.8s ease-out infinite; flex-shrink: 0; }
@keyframes fgPulse { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 255, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(34, 211, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 255, 0); } }
.fg-report-title { position: relative; font-size: 24px; margin: 0 0 10px; color: var(--ink); }
.fg-report-desc { position: relative; color: var(--ink-dim); margin: 0 0 22px; max-width: 52ch; }
.fg-report-actions { position: relative; display: flex; flex-wrap: wrap; gap: 14px; }

.fg-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px;
  font-family: var(--ff-display); font-weight: 500; font-size: 14px;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.fg-btn--primary { background: linear-gradient(135deg, var(--blue-hot), var(--blue-elec)); color: var(--ink-on-accent); font-weight: 600; }
.fg-btn--primary:hover { box-shadow: var(--glow-blue); color: var(--ink-on-accent); }
.fg-btn--ghost { border: 1px solid var(--blue-elec); color: var(--blue-elec); background: rgba(34, 211, 255, 0.04); }
.fg-btn--ghost:hover { background: rgba(34, 211, 255, 0.10); box-shadow: var(--glow-blue); color: var(--blue-elec); }

/* ---- Post navigation (light) --------------------------------------------- */
.fg-postnav .nav-links { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.fg-postnav a {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; max-width: 48%;
  border: 1px solid var(--fg-line-light); color: var(--ink-light);
  transition: border-color 0.2s, background 0.2s;
}
.fg-postnav a:hover { border-color: var(--accent-dark); background: rgba(3,105,161,.04); }
.fg-postnav .nav-next a { text-align: right; margin-left: auto; }
.fg-postnav-dir { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-dark); }
.fg-postnav-title { font-family: var(--ff-display); font-size: 15px; color: var(--ink-body); }
.fg-postnav a:hover .fg-postnav-title { color: var(--ink-light); }

/* ---- Comments (light) ---------------------------------------------------- */
.fg-comments-title { font-size: 20px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px dashed rgba(0,40,90,.18); color: var(--ink-light); }
.fg-comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.fg-comment-list .children { list-style: none; padding-left: 24px; }
.fg-comment-list .comment-body { padding: 16px 0; border-bottom: 1px dashed var(--fg-line-light); }
.fg-comment-list .comment-author { font-family: var(--ff-display); font-size: 14px; color: var(--ink-light); }
.fg-comment-list .comment-author .says { display: none; }
.fg-comment-list .comment-meta { font-family: var(--ff-mono); font-size: 11px; color: var(--fg-muted-light); }
.fg-comment-list .comment-meta a { color: var(--fg-muted-light); }
.fg-comments-closed { color: var(--fg-muted-light); font-family: var(--ff-mono); font-size: 13px; }
.comment-respond { margin-top: 8px; }
.comment-reply-title { font-size: 18px; margin-bottom: 16px; color: var(--ink-light); }
.fg-comments input[type="text"], .fg-comments input[type="email"], .fg-comments input[type="url"], .fg-comments textarea {
  width: 100%; padding: 10px 14px; background: #fff; color: var(--ink-light);
  border: 1px solid rgba(0,40,90,.2); font-family: var(--ff-body); font-size: 15px; margin-bottom: 14px;
}
.fg-comments input:focus, .fg-comments textarea:focus { border-color: var(--accent-dark); outline: none; }
.fg-comments .submit {
  background: linear-gradient(135deg, var(--blue-hot), var(--blue-elec)); color: var(--ink-on-accent);
  border: 0; padding: 12px 24px; font-family: var(--ff-display); font-weight: 600; cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

/* ===========================================================================
   Blog sidebar (right) — LIGHT widgets, scrolls with the content (no sticky)
   ========================================================================= */
.fg-sidebar { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.fg-widget {
  padding: 20px 22px; background: #fff; border: 1px solid var(--fg-line-light);
  box-shadow: 0 6px 20px rgba(3,105,161,.06); overflow-wrap: anywhere;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.fg-widget-title {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-dark); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--fg-line-accent);
}
.fg-widget-posts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.fg-widget-posts a { display: block; }
.fg-widget-post-title { display: block; font-family: var(--ff-display); font-size: 14px; color: var(--ink-light); line-height: 1.35; transition: color .2s; }
.fg-widget-posts a:hover .fg-widget-post-title { color: var(--accent-dark); }
.fg-widget-posts time { display: block; margin-top: 3px; font-family: var(--ff-mono); font-size: 10.5px; color: var(--fg-muted-light); }
.fg-widget-cats { list-style: none; padding: 0; margin: 0; }
.fg-widget-cats li { padding: 7px 0; border-bottom: 1px dashed var(--fg-line-light); font-family: var(--ff-display); font-size: 14px; color: var(--fg-muted-light); }
.fg-widget-cats li:last-child { border-bottom: 0; }
.fg-widget-cats a { color: var(--ink-body); transition: color .2s; }
.fg-widget-cats a:hover { color: var(--accent-dark); }
.fg-widget-cats .children { list-style: none; padding-left: 14px; margin-top: 7px; }
.fg-widget-home { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ff-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); transition: gap .2s; }
.fg-widget-home:hover { gap: 9px; }

/* sidebar search form (light override of the dark base) */
.fg-single-body .fg-searchform { max-width: none; margin-top: 0; gap: 8px; }
.fg-single-body .fg-search-input { background: #fff; color: var(--ink-light); border-color: rgba(0,40,90,.2); padding: 9px 12px; font-size: 14px; }
.fg-single-body .fg-search-input:focus { border-color: var(--accent-dark); }
.fg-single-body .fg-search-submit { background: rgba(3,105,161,.06); color: var(--accent-dark); border-color: var(--accent-dark); padding: 9px 13px; font-size: 13px; }
.fg-single-body .fg-search-submit:hover { background: rgba(3,105,161,.12); }

/* Table of contents (auto, in sidebar) */
.fg-toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.fg-toc-item a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid transparent; font-family: var(--ff-display); font-size: 13.5px; color: var(--ink-body); line-height: 1.4; transition: color .2s, border-color .2s; }
.fg-toc-item a:hover { color: var(--accent-dark); }
.fg-toc-item a.is-active { color: var(--accent-dark); border-left-color: var(--accent-dark); font-weight: 600; }
.fg-toc-h3 a { padding-left: 24px; font-size: 12.5px; color: var(--fg-muted-light); }

/* ===========================================================================
   Search form (DARK base — index/search/404 pages)
   ========================================================================= */
.fg-searchform { display: flex; gap: 10px; max-width: 440px; margin-top: 20px; }
.fg-search-input { flex: 1; min-width: 0; padding: 11px 16px; background: var(--bg-panel-solid); color: var(--ink); border: 1px solid var(--line); font-family: var(--ff-body); font-size: 15px; }
.fg-search-input:focus { border-color: var(--blue-elec); outline: none; }
.fg-search-submit { padding: 11px 20px; background: rgba(34, 211, 255, 0.06); color: var(--blue-elec); border: 1px solid var(--blue-elec); cursor: pointer; font-family: var(--ff-display); font-weight: 500; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.fg-search-submit:hover { background: rgba(34, 211, 255, 0.12); }
.fg-search-term { color: var(--blue-elec); }

/* ===========================================================================
   Footer — minimal brand footer (dark)
   ========================================================================= */
.fg-footer { position: relative; padding: 56px 0 24px; background: linear-gradient(180deg, var(--fg-footer-top) 0%, var(--fg-footer-bot) 100%); border-top: 1px solid rgba(34, 211, 255, 0.10); }
.fg-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(34,211,255,0.4), transparent); }
.fg-footer-inner { max-width: var(--fg-maxw); margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 36px; }
.fg-footer-brand { max-width: 340px; }
.fg-footer-logo img { height: 30px; width: auto; display: block; opacity: 0.95; margin-bottom: 14px; }
.fg-footer-tagline { color: var(--fg-footer-text); font-size: 13px; line-height: 1.55; margin: 0 0 16px; }
.fg-social { display: flex; gap: 10px; }
.fg-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--fg-footer-text); border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); transition: all 0.2s; }
.fg-social a:hover { color: var(--blue-elec); border-color: rgba(34,211,255,0.4); background: rgba(34,211,255,0.06); transform: translateY(-1px); }
.fg-footer-links { display: flex; flex-direction: column; gap: 12px; }
.fg-footer-col-label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue-elec); padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px dashed rgba(34,211,255,0.18); }
.fg-footer-links a { font-family: var(--ff-display); font-size: 14px; color: var(--fg-footer-text); transition: color 0.2s, padding 0.2s; }
.fg-footer-links a:hover { color: var(--blue-elec); padding-left: 4px; }
.fg-footer-bottom { max-width: var(--fg-maxw); margin: 40px auto 0; padding: 22px 24px 0; border-top: 1px solid rgba(255,255,255,0.06); font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--fg-muted-light); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 720px) { .fg-footer-inner { flex-direction: column; gap: 28px; } }

/* ===========================================================================
   FAB cluster — floats bottom-LEFT (near the article text, clear of the
   right sidebar). Contact FAB only on single posts; home FAB hidden on the
   blog landing.
   ========================================================================= */
.fg-fabs {
  position: fixed; left: 22px; bottom: 22px; z-index: 90;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.fg-fab {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 16px;
  font-family: var(--ff-display); font-size: 13px; font-weight: 600;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.fg-fab svg { flex-shrink: 0; }
.fg-fab--accent {
  color: var(--ink-on-accent); background: linear-gradient(135deg, var(--blue-hot), var(--blue-elec));
  box-shadow: 0 8px 28px rgba(0, 102, 255, 0.35), 0 0 0 1px rgba(34, 211, 255, 0.5);
}
.fg-fab--accent:hover { color: var(--ink-on-accent); transform: translateY(-2px); box-shadow: var(--glow-blue), 0 10px 30px rgba(0, 102, 255, 0.4); }
.fg-fab--ghost {
  color: var(--blue-elec); background: rgba(7, 18, 42, 0.9); border: 1px solid var(--blue-elec);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.fg-fab--ghost:hover { color: var(--blue-elec); transform: translateY(-2px); background: rgba(7, 18, 42, 0.98); box-shadow: var(--glow-blue); }
.home .fg-fab--home, .blog .fg-fab--home { display: none; }

/* Cyberpunk flair on the FAB cluster */
.fg-fab::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); pointer-events: none; opacity: 0;
}
.fg-fab:hover::after { opacity: 1; animation: fgFabSheen .7s ease forwards; }
@keyframes fgFabSheen { from { left: -60%; } to { left: 130%; } }
.fg-fab--accent { animation: fgFabPulse 2.6s ease-in-out infinite; }
@keyframes fgFabPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(0,102,255,.35), 0 0 0 1px rgba(34,211,255,.5); }
  50%      { box-shadow: 0 8px 30px rgba(0,102,255,.5), 0 0 0 1px rgba(34,211,255,.85), 0 0 22px rgba(34,211,255,.45); }
}

/* Reading gauge (odometer 0 → 100%) — replicates the top progress line */
.fg-readgauge {
  position: relative; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(closest-side, var(--bg-panel-solid) 76%, transparent 77%),
    conic-gradient(var(--blue-elec) calc(var(--p, 0) * 1%), rgba(34,211,255,.14) 0);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 22px rgba(2,4,10,.5), 0 0 16px rgba(34,211,255,.28);
}
.fg-readgauge::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1px solid rgba(34,211,255,.18); animation: fgGaugePulse 2.4s ease-in-out infinite;
}
@keyframes fgGaugePulse { 0%,100% { opacity: .25; transform: scale(1); } 50% { opacity: .6; transform: scale(1.06); } }
.fg-readgauge-num { position: relative; font-family: var(--ff-mono); font-size: 11px; font-weight: 600; color: var(--blue-elec); }

/* ===========================================================================
   Single layout · responsive
   ========================================================================= */
@media (max-width: 980px) {
  .fg-single-grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 600px) {
  .fg-single-body { padding: 36px 0 48px; }
  .fg-single-grid { padding: 0 18px; }
  .fg-single-hero-inner { padding: 0 18px; }
  .fg-content { font-size: 16px; }
  .fg-content table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .fg-postnav .nav-links { flex-direction: column; }
  .fg-postnav a { max-width: none; }
  .fg-postnav .nav-next a { text-align: left; margin-left: 0; }
  .fg-container { padding: 0 18px 56px; }
  .fg-fabs { left: 14px; bottom: 14px; gap: 8px; }
  .fg-fab { padding: 12px; }
  .fg-fab-text { display: none; }
}

/* ===========================================================================
   Search console — full-page advanced-search dashboard (opened by the FAB)
   ========================================================================= */
.fg-search-modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
  background: rgba(0, 27, 59, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fg-search-modal.is-open { opacity: 1; visibility: visible; }
.fg-search-modal-fx {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(34,211,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,255,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 28%, #000 18%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 28%, #000 18%, transparent 80%);
  animation: fgGridDrift 6s linear infinite;
}
.fg-search-modal-inner {
  position: relative; z-index: 1;
  width: 80%; max-width: 1040px; height: 80vh; max-height: 820px;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(900px 460px at 82% -10%, rgba(34,211,255,.12), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 100%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 110px rgba(2,4,10,.7), 0 0 0 1px rgba(34,211,255,.06);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  padding: clamp(40px, 6vh, 68px) clamp(28px, 5vw, 60px);
}
.fg-search-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(7,18,42,.85); border: 1px solid var(--line-strong); color: var(--ink); cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color .2s, color .2s, background .2s;
}
.fg-search-modal-close:hover { border-color: var(--blue-elec); color: var(--blue-elec); background: rgba(7,18,42,.98); }
.fg-search-modal-kicker { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--blue-elec); }
.fg-search-modal-title { font-size: clamp(28px, 4vw, 44px); margin: 8px 0 26px; color: var(--ink); }

.fg-search-modal-form { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
.fg-search-modal-prompt { font-family: var(--ff-mono); font-size: 22px; color: var(--blue-elec); }
.fg-search-modal-input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font-family: var(--ff-mono); font-size: clamp(18px, 2.4vw, 26px); padding: 10px 0; }
.fg-search-modal-input:focus { outline: none; }
.fg-search-modal-input::placeholder { color: var(--ink-mute); }
.fg-search-modal-form .fg-btn { flex-shrink: 0; }

.fg-search-modal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.fg-search-modal-col { min-width: 0; }
.fg-search-modal-coltitle { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--blue-elec); margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-strong); }

.fg-search-cats { list-style: none; padding: 0; margin: 0; }
.fg-search-cats li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-family: var(--ff-display); font-size: 15px; color: var(--ink-mute); }
.fg-search-cats li:last-child { border-bottom: 0; }
.fg-search-cats a { color: var(--ink-dim); transition: color .2s, padding .2s; }
.fg-search-cats a:hover { color: var(--blue-elec); padding-left: 4px; }

.fg-search-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.fg-search-tags a {
  display: inline-block; font-family: var(--ff-mono); font-size: 12px !important; letter-spacing: .04em;
  color: var(--ink-dim); padding: 5px 12px; border: 1px solid var(--line);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  transition: border-color .2s, color .2s, background .2s;
}
.fg-search-tags a::before { content: "#"; color: var(--blue-elec); margin-right: 2px; }
.fg-search-tags a:hover { color: var(--blue-elec); border-color: var(--blue-elec); background: rgba(34,211,255,.05); }

.fg-search-recent { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fg-search-recent a { font-family: var(--ff-display); font-size: 14px; color: var(--ink-dim); line-height: 1.4; transition: color .2s; }
.fg-search-recent a:hover { color: var(--blue-elec); }
.fg-search-empty { color: var(--ink-mute); font-family: var(--ff-mono); font-size: 13px; }

body.fg-modal-open { overflow: hidden; }

@media (max-width: 760px) {
  .fg-search-modal { padding: 0; }
  .fg-search-modal-inner { width: 94%; height: auto; max-height: 88vh; padding: 48px 22px; }
  .fg-search-modal-grid { grid-template-columns: 1fr; gap: 28px; }
  .fg-search-modal-form { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
