/* ══════════════════════════════════════════════════════════════════
   HUD+ — BLOG
   Same paper system as the HUD+ landing page: warm cream ground,
   ink-only accent with amber highlights, Plus Jakarta Sans + Inter.
   Standalone: does not depend on any other stylesheet.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --paper:    #FAF7F0;
  --paper-2:  #F2EEE3;
  --paper-3:  #EAE4D6;
  --card:     #FFFFFF;
  --ink:      #16140F;
  --ink-2:    #6A6458;
  --ink-3:    #9A9385;
  --line:     rgba(22,20,15,.11);
  --line-2:   rgba(22,20,15,.20);

  --accent:      #16140F;
  --accent-deep: #000000;
  --accent-soft: #ECE8DE;
  --amber:       #C96A1E;
  --amber-soft:  #FBEDDF;
  --amber-line:  rgba(201,106,30,.28);

  --display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 68ch;
  --shell:   1180px;
  --gut:     clamp(20px, 5vw, 44px);
  --micro:   .72rem;
}

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

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

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

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(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

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

/* Cursor glow belongs to the dark system — the paper page does not use it. */
.cursor-glow { display: none; }

/* ── Reading progress ────────────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--ink);
  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: 13px var(--gut);
  background: rgba(250,247,240,.82);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  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: -.04em;
  white-space: nowrap;
}
/* the square glyph from the old mark becomes the HUD+ plus sign */
.tb-mark i {
  font-style: normal;
  font-size: 0;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--ink) url('/hud/hud-icon-128.png') center/cover no-repeat;
  order: -1;
  box-shadow: 0 3px 12px -5px rgba(22,20,15,.5);
}

.tb-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  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(--ink-2);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.tb-nav a:hover { color: var(--ink); background: rgba(22,20,15,.05); }
.tb-nav a[aria-current] { color: var(--ink); background: rgba(22,20,15,.06); font-weight: 600; }

.tb-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  box-shadow: 0 10px 26px -12px rgba(22,20,15,.7);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s;
}
.tb-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(22,20,15,.8); }
.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: 42px var(--gut) 96px;
}
.article-shell { max-width: 880px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 30px;
}
.breadcrumb a { transition: color .16s; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb-sep { color: var(--line-2); }

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

.eyebrow {
  display: inline-block;
  font-family: var(--display);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-index-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 1.03;
  letter-spacing: -.038em;
  margin: 18px 0 18px;
}
.blog-index-hero h1 em { font-style: normal; color: var(--amber); }
.blog-index-hero p {
  max-width: 56ch;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  line-height: 1.66;
}

/* ── Filter chips ────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-2);
  transition: background .18s, color .18s, border-color .18s;
}
.filters button:hover { border-color: var(--line-2); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

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

.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 30px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px -6px rgba(22,20,15,.14);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, border-color .25s;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 20px 40px -22px rgba(22,20,15,.45);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: .74rem;
  font-weight: 500;
  color: var(--ink-3);
}
.post-card-meta .dot { width: 3px; height: 3px; background: var(--ink-3); border-radius: 50%; flex: none; }
.post-card-meta .tag {
  padding: 5px 11px;
  border-radius: 999px;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.post-card h2 {
  font-size: 1.24rem;
  line-height: 1.22;
  letter-spacing: -.03em;
}

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

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

.post-empty {
  grid-column: 1 / -1;
  padding: 56px 24px;
  border-radius: 20px;
  background: var(--paper-2);
  text-align: center;
  font-size: .86rem;
  color: var(--ink-3);
}

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

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-3);
}
.article-meta .dot { width: 3px; height: 3px; background: var(--ink-3); border-radius: 50%; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--display);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

article h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -.04em;
  margin: 18px 0 22px;
}

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

article h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  line-height: 1.14;
  letter-spacing: -.032em;
  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: 800;
  letter-spacing: -.028em;
  margin: 36px 0 12px;
}

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

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

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

article ul, article ol { padding-left: 1.35rem; }
article li { margin-bottom: .5rem; }
article ul li::marker { color: var(--amber); }
article ol li::marker { color: var(--amber); font-weight: 700; }

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

article code {
  font-family: var(--mono);
  font-size: .86em;
  padding: .14em .42em;
  border-radius: 6px;
  background: var(--paper-3);
  color: var(--ink);
}

/* ── TOC ─────────────────────────────────────────────────────── */
.toc {
  margin: 34px 0;
  padding: 24px 26px;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  max-width: var(--measure);
}
.toc-title {
  display: block;
  font-family: var(--display);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-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(--display);
  font-size: .74em;
  font-weight: 800;
  color: var(--amber);
  margin-right: .65rem;
}
.toc a { color: var(--ink-2); box-shadow: none !important; font-weight: 500; }
.toc a:hover { color: var(--ink); }

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

/* ── App entry ───────────────────────────────────────────────── */
.app-entry {
  margin: 26px 0 34px;
  padding: 26px 28px 28px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px -6px rgba(22,20,15,.14);
  max-width: var(--measure);
}
.app-entry.featured {
  border-color: var(--line-2);
  background: linear-gradient(180deg, var(--accent-soft), var(--card) 46%);
  box-shadow: 0 16px 40px -26px rgba(22,20,15,.5);
}

.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(--display);
  font-size: .95rem;
  font-weight: 800;
  color: var(--amber);
}
.app-entry-head h3 { margin: 0; font-size: 1.16rem; letter-spacing: -.03em; }
.app-entry-head h3 em { font-style: normal; font-weight: 500; color: var(--ink-3); }
.app-entry-platform {
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-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(--paper-2);
}
.app-entry-meta dt {
  font-family: var(--display);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.app-entry-meta dd { margin: 6px 0 0; font-size: .86rem; font-weight: 500; color: var(--ink); }

/* ── Comparison table ────────────────────────────────────────── */
.table-wrap {
  max-width: var(--measure);
  margin: 30px 0;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
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(--paper-2);
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
tbody td { color: var(--ink-2); }
tbody tr:hover td { background: var(--paper); }
tbody td:first-child { color: var(--ink); font-weight: 700; }
td .yes { color: #2F7D45; font-weight: 700; }
td .no  { color: var(--ink-3); }

/* ── CTA card ────────────────────────────────────────────────── */
.cta-card {
  margin: 62px 0 0;
  padding: 36px 34px;
  border-radius: 24px;
  background: var(--ink);
  color: var(--paper);
  max-width: var(--measure);
}
.cta-label {
  display: block;
  font-family: var(--display);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #C8C0AF;
  margin-bottom: 12px;
}
.cta-card h2 {
  border: none;
  padding: 0;
  margin: 0 0 12px;
  color: var(--paper);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}
.cta-card p { margin-bottom: 24px; font-size: .95rem; color: #C8C0AF; max-width: none; }
.cta-card a:not(.btn-cta) { color: var(--paper); box-shadow: inset 0 -1px 0 0 rgba(250,247,240,.4); }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 15px 26px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, background .25s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -16px rgba(0,0,0,.8); }
.btn-cta:active { transform: translateY(1px); }
.btn-cta.ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(250,247,240,.32);
}
.btn-cta.ghost:hover { background: rgba(250,247,240,.09); }

/* CTA buttons used outside the dark card */
.article-shell > .btn-cta,
.app-entry .btn-cta { background: var(--ink); color: var(--paper); }

/* ── 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: var(--card);
  border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, border-color .25s;
}
.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 18px 36px -22px rgba(22,20,15,.45);
}
.related-card span {
  display: block;
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.related-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.03em;
  color: var(--ink);
}

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

footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.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: .8rem;
  color: var(--ink-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(--ink); }

/* ══════════════════════════════════════════════════════════════════
   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;
  }
}
