/* ══════════════════════════════════════════════════════════════════
   GAINLOCK — BLOG
   Same system as the GainLock landing page: black ground, volt green
   accent, flare orange highlights, Sora + Inter + JetBrains Mono.
   Standalone: does not depend on shared.css or blog.css.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --void:    #000000;
  --panel:   #0A0C0F;
  --panel-2: #12161C;
  --panel-3: #171C24;
  --line:    rgba(255,255,255,0.09);
  --line-2:  rgba(255,255,255,0.16);

  --text:   #FFFFFF;
  --text-2: #A2ADBA;
  --text-3: #6B7580;

  --volt:      #4ADE80;
  --volt-soft: rgba(74,222,128,.10);
  --volt-line: rgba(74,222,128,.34);
  --steel:     #CBD5E1;
  --flare:     #FF6A3D;
  --gold:      #FBBF24;

  --display: 'Sora', system-ui, -apple-system, sans-serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --measure: 68ch;
  --shell:   1120px;
  --gut:     clamp(20px, 5vw, 40px);
  --r:       20px;
  --micro:   .68rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--void);
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body);
  background: var(--void);
  color: var(--text);
  font-size: 16px;
  line-height: 1.66;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Starfield — the landing page's backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .7;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 78% 9%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.4px 1.4px at 34% 62%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 91% 47%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.1px 1.1px at 55% 88%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 19% 74%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.3px 1.3px at 66% 31%, rgba(255,255,255,.28), transparent),
    radial-gradient(1px 1px at 44% 5%, rgba(255,255,255,.35), transparent);
  background-size: 700px 700px, 900px 900px, 800px 800px, 1100px 1100px, 650px 650px, 950px 950px, 780px 780px, 1000px 1000px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--volt); color: #000; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }

/* ── Cursor glow ─────────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity .5s ease;
  background: radial-gradient(circle, rgba(74,222,128,.075), transparent 68%);
}
.cursor-glow.visible { opacity: 1; }

/* ── Reading progress ────────────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #4ADE80, #16A34A);
  z-index: 200;
  transition: width .1s linear;
}

/* ══════════════════════════════════════════════════════════════════
   TOPBAR — matches the landing-page nav
   ══════════════════════════════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px var(--gut);
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.tb-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -.03em;
  white-space: nowrap;
}
/* the square glyph from the old mark becomes the app icon */
.tb-mark i {
  font-style: normal;
  font-size: 0;
  width: 30px;
  height: 30px;
  flex: none;
  order: -1;
  border-radius: 8px;
  background: var(--panel-2) url('/gainlock/gainlock-icon-128.png') center/cover no-repeat;
  box-shadow: 0 4px 18px -6px rgba(74,222,128,.7);
}

.tb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tb-nav::-webkit-scrollbar { display: none; }
.tb-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.tb-nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.tb-nav a[aria-current] { color: var(--text); background: rgba(255,255,255,.07); font-weight: 600; }

.tb-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4ADE80, #16A34A);
  color: #04120A;
  font-family: var(--display);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  box-shadow: 0 8px 34px -10px rgba(74,222,128,.75), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s;
}
.tb-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -12px rgba(74,222,128,.9), inset 0 1px 0 rgba(255,255,255,.3); }
.tb-cta:active { transform: translateY(1px); }

/* ══════════════════════════════════════════════════════════════════
   SHELLS
   ══════════════════════════════════════════════════════════════════ */

.blog-index-shell,
.article-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 44px var(--gut) 96px;
}
.article-shell { max-width: 880px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 30px;
}
.breadcrumb a { transition: color .16s; }
.breadcrumb a:hover { color: var(--volt); }
.breadcrumb-sep { color: var(--line-2); }

/* ── Index hero ──────────────────────────────────────────────── */
.blog-index-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 40px;
  margin-bottom: 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: .5; }

.blog-index-hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  margin: 20px 0 18px;
}
.blog-index-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #BBF7D0, #4ADE80 50%, #16A34A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.blog-index-hero p {
  max-width: 58ch;
  color: var(--text-2);
  font-size: clamp(1.02rem, 1.25vw, 1.18rem);
  line-height: 1.65;
}

/* ── Filter chips ────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  border: 1px solid var(--line-2);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-2);
  transition: color .18s, border-color .18s, background .18s;
}
.filters button:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
.filters button[aria-pressed="true"] {
  background: linear-gradient(135deg, #4ADE80, #16A34A);
  border-color: transparent;
  color: #04120A;
}

/* ── Post grid ───────────────────────────────────────────────── */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 30px;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), border-color .25s, box-shadow .25s;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--volt-line);
  box-shadow: 0 22px 46px -26px rgba(74,222,128,.55);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.post-card-meta .dot { width: 3px; height: 3px; background: var(--text-3); border-radius: 50%; flex: none; }
.post-card-meta .tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--volt-line);
  background: var(--volt-soft);
  color: var(--volt);
  font-size: var(--micro);
  letter-spacing: .1em;
}

.post-card h2 {
  font-size: 1.2rem;
  line-height: 1.24;
  letter-spacing: -.03em;
}
.post-card:hover h2 { color: var(--text); }

.post-card p { font-size: .9rem; line-height: 1.62; color: var(--text-2); }

.post-card-more {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 700;
  color: var(--volt);
}

.post-empty {
  grid-column: 1 / -1;
  padding: 56px 24px;
  border-radius: var(--r);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ══════════════════════════════════════════════════════════════════
   ARTICLE
   ══════════════════════════════════════════════════════════════════ */

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.article-meta .dot { width: 3px; height: 3px; background: var(--text-3); border-radius: 50%; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--volt-line);
  background: var(--volt-soft);
  color: var(--volt);
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

article h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.038em;
  margin: 20px 0 22px;
}

.article-lede {
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.62;
  color: var(--text-2);
  max-width: var(--measure);
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

article h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  margin: 62px 0 16px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

/* the lede already draws a rule — don't stack a second one on the first heading */
.article-lede + h2 { border-top: 0; padding-top: 0; margin-top: 44px; }

article h3 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -.028em;
  margin: 36px 0 12px;
}

article p,
article ul,
article ol {
  max-width: var(--measure);
  margin-bottom: 1.15rem;
  color: var(--text-2);
}

article p strong,
article li strong { color: var(--text); font-weight: 600; }

article a:not(.btn-cta):not(.related-card) {
  color: var(--text);
  font-weight: 500;
  box-shadow: inset 0 -1px 0 0 var(--volt-line);
  transition: color .16s, box-shadow .16s;
}
article a:not(.btn-cta):not(.related-card):hover {
  color: var(--volt);
  box-shadow: inset 0 -1px 0 0 var(--volt);
}

article ul, article ol { padding-left: 1.35rem; }
article li { margin-bottom: .5rem; }
article ul li::marker { color: var(--volt); }
article ol li::marker { color: var(--volt); font-family: var(--mono); font-size: .9em; }

article em { color: var(--text); font-style: italic; }

article code {
  font-family: var(--mono);
  font-size: .86em;
  padding: .14em .42em;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

/* ── TOC ─────────────────────────────────────────────────────── */
.toc {
  margin: 34px 0;
  padding: 24px 26px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--volt);
  max-width: var(--measure);
}
.toc-title {
  display: block;
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}
.toc ol { list-style: none; padding: 0; margin: 0; max-width: none; counter-reset: toc; }
.toc li {
  counter-increment: toc;
  margin-bottom: .45rem;
  font-size: .9rem;
  line-height: 1.55;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .76em;
  color: var(--volt);
  margin-right: .65rem;
}
.toc a { color: var(--text-2); box-shadow: none !important; font-weight: 500; }
.toc a:hover { color: var(--volt); }

/* ── Callout ─────────────────────────────────────────────────── */
.callout {
  margin: 34px 0;
  padding: 24px 26px;
  border-radius: 18px;
  background: var(--volt-soft);
  border: 1px solid var(--volt-line);
  max-width: var(--measure);
}
.callout-label {
  display: block;
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--volt);
  margin-bottom: 10px;
}
.callout p { margin: 0; color: var(--text); }
.callout p + p { margin-top: .7rem; }

/* ── App entry ───────────────────────────────────────────────── */
.app-entry {
  margin: 26px 0 34px;
  padding: 26px 28px 28px;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  max-width: var(--measure);
}
.app-entry.featured {
  border-color: var(--volt-line);
  background: linear-gradient(180deg, var(--volt-soft), var(--panel) 52%);
  box-shadow: 0 20px 48px -30px rgba(74,222,128,.6);
}

.app-entry-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.app-entry-rank {
  font-family: var(--mono);
  font-size: .84rem;
  font-weight: 700;
  color: var(--volt);
  letter-spacing: .06em;
}
.app-entry-head h3 { margin: 0; font-size: 1.14rem; letter-spacing: -.03em; }
.app-entry-head h3 em { font-style: normal; font-weight: 400; color: var(--text-3); }
.app-entry-platform {
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.app-entry p { max-width: none; font-size: .93rem; }
.app-entry p:last-of-type { margin-bottom: 0; }

.app-entry-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.app-entry-meta > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-3);
  border: 1px solid var(--line);
}
.app-entry-meta dt {
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.app-entry-meta dd { margin: 6px 0 0; font-size: .86rem; font-weight: 500; color: var(--text); }

/* ── Comparison table ────────────────────────────────────────── */
.table-wrap {
  max-width: var(--measure);
  margin: 30px 0;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 520px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
thead th {
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
tbody td { color: var(--text-2); }
tbody tr:hover td { background: var(--panel-2); }
tbody td:first-child { color: var(--text); font-weight: 600; }
td .yes { color: var(--volt); font-weight: 700; }
td .no  { color: var(--flare); }

/* ── CTA card ────────────────────────────────────────────────── */
.cta-card {
  margin: 62px 0 0;
  padding: 36px 34px;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--panel-3), var(--panel));
  border: 1px solid var(--volt-line);
  max-width: var(--measure);
}
.cta-label {
  display: block;
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--volt);
  margin-bottom: 12px;
}
.cta-card h2 {
  border: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}
.cta-card p { margin-bottom: 24px; font-size: .95rem; max-width: none; }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4ADE80, #16A34A);
  color: #04120A;
  font-family: var(--display);
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  box-shadow: 0 8px 34px -10px rgba(74,222,128,.75), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, background .25s, border-color .25s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -12px rgba(74,222,128,.9), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-cta:active { transform: translateY(1px); }
.btn-cta.ghost {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-2);
  color: var(--text);
  box-shadow: none;
}
.btn-cta.ghost:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.3); box-shadow: none; }

/* ── Related ─────────────────────────────────────────────────── */
.article-foot { margin-top: 72px; }
.article-foot > .eyebrow { display: block; margin-bottom: 16px; }

.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.related-card {
  display: block;
  padding: 22px 24px 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), border-color .25s, box-shadow .25s;
}
.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--volt-line);
  box-shadow: 0 20px 40px -26px rgba(74,222,128,.5);
}
.related-card span {
  display: block;
  font-family: var(--mono);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--volt);
  margin-bottom: 8px;
}
.related-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.03em;
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════ */

footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.footer-inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-3);
}
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; list-style: none; }
.footer-links a { font-weight: 500; transition: color .16s; }
.footer-links a:hover { color: var(--volt); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 860px) {
  .tb-nav { margin: 0 auto 0 8px; }
  .tb-cta { padding: 10px 16px; font-size: .8rem; }
}

@media (max-width: 620px) {
  .blog-index-shell, .article-shell { padding-top: 30px; padding-bottom: 68px; }
  .tb-nav {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
  }
  .tb-cta { display: none; }
  .post-list, .related { grid-template-columns: 1fr; }
  .app-entry-platform { margin-left: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .01ms !important;
  }
}
