/* ════════════════════════════════════════════════════════════════
   HYPERFIX LABS — BLOG (cyber brutalist, long-form readable)
   Standalone: does not depend on shared.css.
   ════════════════════════════════════════════════════════════════ */

:root {
  --ink:      #050505;
  --ink-2:    #0a0a0b;
  --panel:    #0d0d10;
  --panel-2:  #121216;
  --line:     #23232a;
  --line-2:   #33333d;
  --bone:     #eae8e2;
  --bone-2:   #a5a49d;
  --bone-3:   #6d6c66;
  --red:      #ff2b1f;
  --red-soft: rgba(255, 43, 31, 0.12);
  --red-line: rgba(255, 43, 31, 0.42);

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --display: 'Archivo Black', 'Arial Black', system-ui, sans-serif;

  --measure: 68ch;
  --micro: 0.66rem;
}

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

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--mono);
  background: var(--ink);
  color: var(--bone);
  font-size: 0.95rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--red); color: #fff; }

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

/* ── Cursor glow ─────────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(circle, rgba(255, 43, 31, 0.075), transparent 68%);
}
.cursor-glow.visible { opacity: 1; }

/* ── Reading progress ────────────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--red);
  z-index: 60;
  transition: width 0.1s linear;
}

/* ════════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: 46px;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.tb-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 1.15rem;
  border-right: 1px solid var(--line);
  background: var(--bone);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tb-mark i { font-style: normal; color: var(--red); }

.tb-nav {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tb-nav::-webkit-scrollbar { display: none; }
.tb-nav {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
}

.tb-nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  border-right: 1px solid var(--line);
  font-size: var(--micro);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-2);
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}
.tb-nav a:hover { color: var(--bone); background: var(--panel-2); }
.tb-nav a[aria-current] { color: var(--red); }

.tb-cta {
  display: flex;
  align-items: center;
  padding: 0 1.15rem;
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}
.tb-cta:hover { background: var(--bone); color: var(--ink); }

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

.blog-index-shell,
.article-shell {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.4rem 1.4rem 5rem;
}

.article-shell { max-width: 900px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: var(--micro);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 2rem;
}
.breadcrumb a { transition: color 0.16s; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb-sep { color: var(--line-2); }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.blog-index-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 6.4vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 1rem 0 0.9rem;
}
.blog-index-hero h1 em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--red);
}
.blog-index-hero p {
  max-width: 62ch;
  color: var(--bone-2);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* ── Filter chips ────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.8rem;
}
.filters button {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line-2);
  font-size: var(--micro);
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-2);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.filters button:hover { border-color: var(--bone-3); color: var(--bone); }
.filters button[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Post grid ───────────────────────────────────────────────── */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.5rem 1.4rem 1.7rem;
  background: var(--panel);
  transition: background 0.2s;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.26s ease;
}
.post-card:hover { background: var(--panel-2); }
.post-card:hover::before { transform: scaleY(1); }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: var(--micro);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.post-card-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--line-2);
  border-radius: 50%;
  flex: none;
}
.post-card-meta .tag { color: var(--red); }

.post-card h2 {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.005em;
}
.post-card:hover h2 { color: #fff; }

.post-card p {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--bone-2);
}

.post-card-more {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: var(--micro);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-3);
  transition: color 0.18s;
}
.post-card:hover .post-card-more { color: var(--red); }

.post-empty {
  grid-column: 1 / -1;
  padding: 3rem 1.4rem;
  background: var(--panel);
  text-align: center;
  font-size: var(--micro);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-3);
}

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

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: var(--micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.article-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--line-2);
  border-radius: 50%;
}
.tag {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--red-line);
  color: var(--red);
  letter-spacing: 0.15em;
}

article h1 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 5.2vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 1.3rem 0 1.4rem;
}

.article-lede {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--bone);
  max-width: var(--measure);
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

article h2 {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.9vw, 1.8rem);
  line-height: 1.14;
  letter-spacing: -0.018em;
  text-transform: uppercase;
  margin: 3rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
article h2::before {
  content: '// ';
  color: var(--red);
}

article h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  margin: 2rem 0 0.75rem;
}

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

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

article a:not(.btn-cta):not(.related-card) {
  color: var(--bone);
  border-bottom: 1px solid var(--red-line);
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
article a:not(.btn-cta):not(.related-card):hover {
  color: var(--red);
  border-color: var(--red);
}

article ul,
article ol { padding-left: 1.35rem; }
article li { margin-bottom: 0.5rem; }
article ul li::marker { color: var(--red); }
article ol li::marker { color: var(--red); font-family: var(--mono); }

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

article code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--bone);
}

/* ── TOC ─────────────────────────────────────────────────────── */
.toc {
  margin: 2.2rem 0;
  padding: 1.2rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--red);
  max-width: var(--measure);
}
.toc-title {
  display: block;
  font-size: var(--micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 0.8rem;
}
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.55;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero) ' ';
  color: var(--red);
  margin-right: 0.5rem;
}
.toc a { color: var(--bone-2); border: none !important; }
.toc a:hover { color: var(--red); }

/* ── Callout ─────────────────────────────────────────────────── */
.callout {
  margin: 2rem 0;
  padding: 1.2rem 1.3rem;
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  max-width: var(--measure);
}
.callout-label {
  display: block;
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.55rem;
}
.callout p { margin: 0; color: var(--bone); }
.callout p + p { margin-top: 0.7rem; }

/* ── App entry ───────────────────────────────────────────────── */
.app-entry {
  margin: 1.6rem 0 2.2rem;
  padding: 1.3rem 1.4rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: var(--measure);
}
.app-entry.featured {
  border-color: var(--red-line);
  background: linear-gradient(180deg, var(--red-soft), transparent 55%), var(--panel);
}

.app-entry-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.8rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.app-entry-rank {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--red);
  letter-spacing: 0.02em;
}
.app-entry-head h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}
.app-entry-head h3 em {
  font-style: normal;
  font-weight: 400;
  color: var(--bone-3);
}
.app-entry-platform {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-2);
  font-size: var(--micro);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.app-entry p { max-width: none; font-size: 0.87rem; }
.app-entry p:last-of-type { margin-bottom: 0; }

.app-entry-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 1.1rem;
  background: var(--line);
  border: 1px solid var(--line);
}
.app-entry-meta > div { background: var(--panel-2); padding: 0.6rem 0.7rem; }
.app-entry-meta dt {
  font-size: var(--micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.app-entry-meta dd {
  margin: 0.28rem 0 0;
  font-size: 0.8rem;
  color: var(--bone);
}

/* ── Comparison table ────────────────────────────────────────── */
.table-wrap {
  max-width: var(--measure);
  margin: 1.8rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 520px;
}
th, td {
  padding: 0.65rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
th:last-child, td:last-child { border-right: none; }
tr:last-child td { border-bottom: none; }
thead th {
  background: var(--panel-2);
  font-size: var(--micro);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-3);
  font-weight: 500;
}
tbody td { color: var(--bone-2); background: var(--panel); }
tbody tr:hover td { background: var(--panel-2); }
tbody td:first-child { color: var(--bone); font-weight: 700; }
td .yes { color: var(--red); }
td .no  { color: var(--bone-3); }

/* ── CTA card ────────────────────────────────────────────────── */
.cta-card {
  margin: 3rem 0 0;
  padding: 1.8rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-top: 2px solid var(--red);
  max-width: var(--measure);
}
.cta-label {
  display: block;
  font-size: var(--micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.7rem;
}
.cta-card h2 {
  border: none;
  padding: 0;
  margin: 0 0 0.7rem;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
}
.cta-card h2::before { content: none; }
.cta-card p { margin-bottom: 1.3rem; font-size: 0.87rem; }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.2rem;
  background: var(--red);
  color: #fff;
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--red);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.btn-cta:hover { background: var(--bone); border-color: var(--bone); color: var(--ink); transform: translateY(-1px); }
.btn-cta.ghost { background: transparent; color: var(--bone); border-color: var(--line-2); }
.btn-cta.ghost:hover { background: var(--panel-2); border-color: var(--bone-3); color: var(--bone); }

/* ── Related ─────────────────────────────────────────────────── */
.article-foot { margin-top: 3.5rem; }
.article-foot > .eyebrow { margin-bottom: 1rem; display: block; }

.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.related-card {
  display: block;
  padding: 1.2rem 1.2rem 1.3rem;
  background: var(--panel);
  transition: background 0.2s;
}
.related-card:hover { background: var(--panel-2); }
.related-card span {
  display: block;
  font-size: var(--micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.related-card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--bone);
}

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

footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.6rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: var(--micro);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.footer-links {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  list-style: none;
}
.footer-links a { transition: color 0.16s; }
.footer-links a:hover { color: var(--red); }

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

@media (max-width: 620px) {
  body { font-size: 0.92rem; }
  .blog-index-shell, .article-shell { padding: 1.6rem 1rem 3.5rem; }
  .tb-mark { padding: 0 0.85rem; font-size: 0.66rem; }
  .tb-nav a { padding: 0 0.75rem; }
  .tb-cta { padding: 0 0.85rem; }
  .app-entry-platform { margin-left: 0; }
  /* give the nav its full width back; the in-article CTA covers conversion */
  .tb-cta { display: none; }
  .tb-nav { -webkit-mask-image: none; mask-image: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

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