/* ==========================================================================
   Xoft Journal · blog index and article pages. Builds on ../styles.css tokens.
   Same colour allocation: ink surfaces, warm neutrals, orange only for the
   wordmark, primary actions, active states and the reading-progress line.
   ========================================================================== */

.journal-page main { padding-top: 72px; }

/* Nav */
.bnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 72px;
  display: flex; align-items: center; gap: 12px;
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  border-bottom: 1px solid transparent; transition: background-color .5s, border-color .5s;
}
.bnav .wordmark { margin-right: auto; }
.bnav.is-scrolled { background: rgba(11, 10, 9, .72); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-bottom-color: var(--line); }
.bnav__links { display: flex; gap: 2px; }
.bnav__links a { padding: 8px 14px; font-size: 15px; color: var(--muted); border-radius: 999px; transition: color .3s; }
.bnav__links a:hover { color: var(--text); }
.bnav__links a.is-active { background: var(--ink-hi); color: var(--text); }
@media (max-width: 560px) {
  .bnav .btn { display: none; }
  .bnav__links a { padding: 8px 12px; }
}

/* Reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: left; }

/* Shared bits */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--dim); font-size: 13px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; font-weight: 500; }
.link svg, .card__foot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease); }
.link:hover svg, a:hover > .link svg { transform: translateX(4px); }
.rv { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* Journal hero */
.jhero { padding-top: clamp(70px, 10vw, 150px); padding-bottom: clamp(40px, 5vw, 70px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(245, 153, 46, .5); animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(245, 153, 46, .45); } 70%, 100% { box-shadow: 0 0 0 10px rgba(245, 153, 46, 0); } }
.jhero h1 { margin: 22px 0 0; font-size: clamp(46px, 8vw, 128px); line-height: .95; letter-spacing: -0.055em; font-weight: 500; max-width: 13ch; text-wrap: balance; }
.jhero h1 em { font-style: normal; color: var(--soft); }
.jhero .lede { margin-top: 30px; max-width: 58ch; }

/* Featured */
.feature {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(20px, 3vw, 48px); align-items: stretch;
  padding: 14px; border-radius: calc(var(--r) + 6px); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .5s var(--ease);
}
.feature:hover { border-color: var(--line-2); }
.feature__art { width: 100%; height: clamp(300px, 34vw, 480px); border-radius: var(--r); background: radial-gradient(80% 90% at 70% 30%, #1d1712, #0f0d0b 70%); }
.feature__text { display: flex; flex-direction: column; gap: 18px; padding: clamp(10px, 2vw, 28px) clamp(6px, 1.5vw, 20px) clamp(10px, 2vw, 28px) 0; }
.feature__label { color: var(--muted); font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.feature h2 { margin: 6px 0 0; font-size: clamp(28px, 3.2vw, 48px); line-height: 1.05; letter-spacing: -0.045em; font-weight: 500; text-wrap: balance; }
.feature p { margin: 0; color: var(--muted); max-width: 46ch; }
.feature .link { margin-top: auto; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: clamp(56px, 7vw, 96px) 0 28px; }
.filters button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 14px; transition: color .3s, background-color .3s, border-color .3s; }
.filters button sup { font-family: var(--f-mono); font-size: 10.5px; color: var(--dim); margin-left: 2px; }
.filters button:hover { color: var(--text); border-color: rgba(239, 232, 223, .35); }
.filters button.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters button.is-on sup { color: #6c645b; }
.empty { color: var(--muted); padding: 40px 0; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card[hidden] { display: none; }
.card {
  display: flex; flex-direction: column; gap: 14px; padding: 12px 12px 22px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .5s var(--ease), transform .7s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-5px); }
.card__art { width: 100%; height: 210px; border-radius: 16px; background: radial-gradient(80% 90% at 70% 30%, #1d1712, #0f0d0b 70%); margin-bottom: 6px; }
.card > :not(canvas) { margin-inline: 10px; }
.card h3 { margin: 0; font-size: clamp(20px, 1.6vw, 24px); line-height: 1.2; letter-spacing: -0.03em; font-weight: 500; text-wrap: balance; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; color: var(--dim); font-size: 13px; }
.card__foot i { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted); transition: all .5s var(--ease); }
.card:hover .card__foot i { background: var(--orange); border-color: var(--orange); color: var(--bg); }
.card:hover .card__foot svg { transform: translateX(2px); }

/* CTA */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  margin: clamp(80px, 10vw, 140px) 0; padding: clamp(28px, 4vw, 56px); border-radius: calc(var(--r) + 6px);
  background: radial-gradient(70% 120% at 100% 0%, rgba(245, 153, 46, .07), transparent 60%), var(--surface); border: 1px solid var(--line);
}
.cta h2 { margin: 0; font-size: clamp(28px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -0.045em; font-weight: 500; }
.cta p { margin: 14px 0 0; color: var(--muted); max-width: 52ch; }

/* Article */
.article__head { max-width: 1040px; padding-top: clamp(50px, 7vw, 110px); padding-bottom: clamp(36px, 4vw, 56px); }
.back { display: inline-flex; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 36px; transition: color .3s; }
.back:hover { color: var(--text); }
.article__title { margin: 22px 0 0; font-size: clamp(38px, 5.6vw, 84px); line-height: 1; letter-spacing: -0.05em; font-weight: 500; text-wrap: balance; }
.article__lede { margin: 28px 0 0; color: var(--muted); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; max-width: 60ch; }
.article__cover { width: 100%; height: clamp(240px, 36vw, 520px); border-radius: calc(var(--r) + 6px); border: 1px solid var(--line); background: radial-gradient(80% 90% at 70% 30%, #1d1712, #0f0d0b 70%); }

.article__grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); padding-top: clamp(50px, 6vw, 90px); }
.toc { position: sticky; top: 110px; align-self: start; font-size: 14px; }
.toc p { margin: 0 0 14px; color: var(--dim); font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.toc nav { display: grid; gap: 2px; border-left: 1px solid var(--line-2); }
.toc nav a { padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); line-height: 1.35; transition: color .3s, border-color .3s; }
.toc nav a:hover { color: var(--text); }
.toc nav a.is-on { color: var(--text); border-left-color: var(--orange); }
.share { display: grid; justify-items: start; gap: 8px; margin-top: 40px; }
.share a, .share button { color: var(--muted); font-size: 14px; transition: color .3s; }
.share a:hover, .share button:hover { color: var(--text); }

.prose { max-width: 700px; }
.prose p, .prose li { color: #cfc6bb; font-size: clamp(17px, 1.25vw, 19px); line-height: 1.8; }
.prose p { margin: 0 0 24px; }
.prose > p:first-child { color: var(--text); font-size: clamp(19px, 1.5vw, 22px); line-height: 1.65; }
.prose h2 { margin: 56px 0 16px; font-size: clamp(24px, 2vw, 30px); line-height: 1.2; letter-spacing: -0.03em; font-weight: 500; scroll-margin-top: 100px; }
.prose ul { margin: 0 0 28px; padding: 0; list-style: none; display: grid; gap: 12px; }
.prose li { position: relative; padding-left: 28px; }
.prose li::before { content: ""; position: absolute; left: 4px; top: .78em; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.prose strong { color: var(--text); font-weight: 500; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.prose a:hover { text-decoration-color: var(--orange); }
.byline { margin-top: 48px !important; padding-top: 24px; border-top: 1px solid var(--line); color: var(--dim) !important; font-size: 15px !important; }

.more { padding-top: clamp(80px, 10vw, 140px); }
.more__head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.more__head h2 { margin: 0; font-size: clamp(30px, 3.6vw, 52px); letter-spacing: -0.045em; font-weight: 500; line-height: 1; }

@media (max-width: 1024px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature__text { padding: 10px 10px 16px; }
  .article__grid { grid-template-columns: 1fr; }
  .toc { position: static; order: 2; border-top: 1px solid var(--line); padding-top: 32px; }
  .toc > p:first-child, .toc nav { display: none; }
  .share { margin-top: 0; grid-auto-flow: column; gap: 22px; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .card__art { height: 190px; }
  .feature__art { height: 260px; }
  .cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .eyebrow i { animation: none; }
}
