/* =====================================================================
   Assertive Innovations — blog
   Cards (home Journal section + blog list), the blog page header,
   the list page and the article page. Sits on top of styles.css and
   site.css (black & silver identity).
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. CARDS: soft tilted cards, category pill, pinned post gets a pin
   --------------------------------------------------------------------- */
.bgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 2.6vw, 36px); align-items: stretch; }
.bgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* cards in a row share one height, so no empty gap is left under the shorter one */
.bgrid > .bc-cell { min-width: 0; display: flex; }
.bgrid > .bc-cell > .bcard { flex: 1; }

.bcard {
  position: relative; display: flex; flex-direction: column; gap: 16px;
  padding: clamp(14px, 1.3vw, 18px) clamp(14px, 1.3vw, 18px) clamp(20px, 2vw, 26px); border-radius: 30px; text-decoration: none; color: #E5E5E5;
  background: linear-gradient(165deg, #1B1B1B 0%, #121212 55%, #0D0D0D 100%);
  border: 1px solid rgba(192, 192, 192, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 34px 60px -34px rgba(0, 0, 0, .95);
  transform: rotate(var(--rot, 0deg)) translateZ(0);
  backface-visibility: hidden; -webkit-font-smoothing: antialiased;
  transition: transform .8s var(--ease-out, ease), border-color .4s, box-shadow .7s var(--ease-out, ease);
}
.bcard:hover, .bcard:focus-visible {
  transform: rotate(var(--rot, 0deg)) translateY(-4px) translateZ(0);
  border-color: rgba(229, 229, 229, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 46px 80px -34px rgba(0, 0, 0, 1), 0 0 60px -20px rgba(229, 229, 229, .14);
}
.bcard:focus-visible { outline: 2px solid #E5E5E5; outline-offset: 6px; border-radius: 30px; }
.bcard > :not(.bc-cover):not(.bc-pin) { margin-inline: clamp(8px, 1vw, 14px); }
.bc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bc-pill { display: inline-flex; padding: 7px 16px; border: 1px solid rgba(192, 192, 192, .3); border-radius: 999px; font-size: 13.5px; line-height: 1.2; color: #DADADA; background: rgba(255, 255, 255, .03); }
.bc-title { margin: 4px 0 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.4rem, 1.05rem + .95vw, 1.95rem); line-height: 1.16; letter-spacing: -0.01em; color: #F4F4F4; text-wrap: balance; }
.bcard:hover .bc-title { background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.bc-ex { color: #A3A3A3; font-size: 1rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bc-meta { margin-top: auto; padding-top: 4px; display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: #8A8A8A; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.bc-pin { position: absolute; z-index: 2; top: -24px; right: 8px; width: 46px; height: 54px; transform: rotate(10deg); transition: transform .6s var(--ease-out, ease); pointer-events: none; }
.bcard:hover .bc-pin { transform: rotate(0deg) translateY(-3px); }
.bc-cover { position: relative; display: block; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; background: #1A1A1A; }
.bc-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); background: linear-gradient(180deg, transparent 55%, rgba(8, 8, 8, .35)); pointer-events: none; }
.bc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out, ease); }
.bcard:hover .bc-cover img { transform: scale(1.05); }

/* ---------------------------------------------------------------------
   2. HOME: JOURNAL SECTION
   --------------------------------------------------------------------- */
body.site .journal { position: relative; border-top: 1px solid var(--line); }
.jn-in { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr); gap: clamp(40px, 6vw, 110px); align-items: start; padding-block: clamp(90px, 11vw, 170px); }
.jn-head { position: sticky; top: 120px; display: grid; gap: 24px; justify-items: start; }
.jn-lead { color: var(--muted); max-width: 40ch; font-size: 1.05rem; }
.jn-grid { padding-top: 28px; }

/* ---------------------------------------------------------------------
   3. BLOG PAGE: header & footer
   --------------------------------------------------------------------- */
body.blog-page .site-header { position: sticky; top: 0; padding: 18px var(--gut-r) 18px var(--gut-l); color: var(--cream); background: rgba(8, 8, 8, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); gap: 20px; }
.bh-brand { width: 170px; color: #EDEDED; display: block; }
.bh-brand .logo-img { max-height: 40px; }
.bh-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 14.5px; }
.bh-nav a:not(.btn) { color: #BDBDBD; text-decoration: none; transition: color .3s; }
.bh-nav a:not(.btn):hover, .bh-nav a[aria-current="page"] { color: #fff; }
.bh-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: rgba(229, 229, 229, .5); }

/* ---------------------------------------------------------------------
   4. BLOG LIST PAGE
   --------------------------------------------------------------------- */
.bl-hero { padding-block: clamp(70px, 9vw, 130px) clamp(30px, 4vw, 50px); display: grid; gap: 26px; justify-items: start; }
.bl-hero .gt { font-size: clamp(3.4rem, 1rem + 9vw, 10rem); }
.bl-lead { color: var(--muted); max-width: 56ch; font-size: 1.08rem; }
.bl-tools { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: clamp(36px, 5vw, 60px); border-bottom: 1px solid var(--line); margin-bottom: clamp(48px, 6vw, 80px); }
.bl-cats { display: flex; gap: 10px; flex-wrap: wrap; }
.bl-cat { padding: 9px 18px; border-radius: 999px; border: 1px solid rgba(192, 192, 192, .25); background: transparent; font-size: 14px; color: #C9C9C9; transition: background .3s, color .3s, border-color .3s; }
.bl-cat:hover { border-color: rgba(229, 229, 229, .6); color: #fff; }
.bl-cat[aria-pressed="true"] { background: var(--plate); color: #080808; border-color: transparent; }
.bl-search { position: relative; flex: 0 1 300px; }
.bl-search input { width: 100%; height: 46px; padding: 0 18px 0 44px; border-radius: 999px; border: 1px solid rgba(192, 192, 192, .25); background: #111; color: #EDEDED; font: inherit; font-size: 15px; }
.bl-search input:focus { outline: none; border-color: #E5E5E5; }
.bl-search svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: #858585; stroke-width: 2; }
.bl-empty { padding: 60px 0; color: var(--muted); text-align: center; grid-column: 1 / -1; }
.bl-list { padding-bottom: clamp(90px, 10vw, 150px); }

/* ---------------------------------------------------------------------
   5. ARTICLE PAGE
   --------------------------------------------------------------------- */
.ar { padding-bottom: clamp(80px, 10vw, 140px); }
.ar-head { max-width: 900px; margin-inline: auto; padding-block: clamp(50px, 7vw, 100px) clamp(30px, 4vw, 50px); display: grid; gap: 24px; justify-items: start; }
.ar-crumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: #858585; list-style: none; margin: 0; padding: 0; }
.ar-crumb li + li::before { content: "/"; margin-right: 8px; color: #555; }
.ar-crumb a { color: #BDBDBD; text-decoration: none; }
.ar-crumb a:hover { color: #fff; }
.ar-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.3rem, 1.2rem + 3.8vw, 4.6rem); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance;
  background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ar-dek { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: #B0B0B0; max-width: 60ch; line-height: 1.6; }
.ar-meta { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; font-size: 14px; color: #8A8A8A; }
.ar-meta b { color: #D6D6D6; font-weight: 500; }
.ar-cover { max-width: 1200px; margin: 0 auto clamp(40px, 6vw, 80px); border-radius: 30px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 8; background: #151515; }
.ar-cover img { width: 100%; height: 100%; object-fit: cover; }

.prose { max-width: 720px; margin-inline: auto; font-size: 1.12rem; line-height: 1.8; color: #C4C4C4; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); line-height: 1.15; color: #F2F2F2; margin-top: 2em; scroll-margin-top: 110px; }
.prose h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; color: #EDEDED; margin-top: 1.7em; scroll-margin-top: 110px; }
.prose a { color: #fff; text-decoration: underline; text-decoration-color: rgba(229, 229, 229, .45); text-underline-offset: 4px; }
.prose a:hover { text-decoration-color: #fff; }
.prose strong { color: #F2F2F2; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: #8F8F8F; }
.prose blockquote { margin-inline: 0; padding: 6px 0 6px 26px; border-left: 2px solid; border-image: linear-gradient(180deg, #FFFFFF, #5E5E5E) 1; font-family: var(--f-display); font-size: clamp(1.3rem, 1.1rem + .8vw, 1.75rem); line-height: 1.35; color: #EDEDED; }
.prose code { font-size: .9em; padding: 2px 7px; border-radius: 6px; background: #1C1C1C; border: 1px solid var(--line); color: #EDEDED; }
.prose figure { margin-inline: 0; }
.prose figure img { width: 100%; border-radius: 20px; border: 1px solid var(--line); }
.prose figcaption { margin-top: 10px; font-size: 14px; color: #858585; text-align: center; }

.ar-foot { max-width: 720px; margin: clamp(50px, 6vw, 80px) auto 0; padding-top: 30px; border-top: 1px solid var(--line); display: grid; gap: 26px; }
.ar-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.ar-tags span { padding: 6px 14px; border-radius: 999px; background: #161616; border: 1px solid var(--line); font-size: 13px; color: #BDBDBD; }
.ar-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: #858585; }
.ar-share a, .ar-share button { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(192, 192, 192, .25); background: transparent; color: #D6D6D6; font-size: 13.5px; text-decoration: none; transition: background .3s, color .3s; }
.ar-share a:hover, .ar-share button:hover { background: #E5E5E5; color: #080808; }
.ar-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ar-nav a { display: grid; gap: 6px; padding: 20px 22px; border-radius: 20px; border: 1px solid var(--line); text-decoration: none; transition: border-color .3s, background .3s; }
.ar-nav a:hover { border-color: rgba(229, 229, 229, .4); background: #111; }
.ar-nav small { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #858585; }
.ar-nav b { font-weight: 500; color: #EDEDED; line-height: 1.35; }
.ar-nav .next { text-align: right; grid-column: 2; }
.ar-more { margin-top: clamp(80px, 10vw, 140px); }
.ar-more-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: clamp(40px, 5vw, 64px); }
.ar-cta { margin-top: clamp(80px, 10vw, 130px); padding: clamp(40px, 6vw, 80px); border-radius: 30px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 0% 0%, #222 0%, #0C0C0C 60%); display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.ar-cta h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); line-height: 1.05; color: #F2F2F2; max-width: 18ch; }
.ar-missing { padding-block: clamp(100px, 14vw, 200px); display: grid; gap: 22px; justify-items: start; }

/* ---------------------------------------------------------------------
   GREEN AMBIENT LIGHT: soft brand-green glows behind the page content.
   Fixed to the screen on computers; on phones they repeat down the page.
   --------------------------------------------------------------------- */
/* One fixed light layer over the whole page (site.html and blog.html).
   It never repaints while scrolling, so it stays perfectly still and smooth.
   "screen" blending lifts only the dark areas; text and images stay clean.
   Strength: change the alpha values (.20 / .14 / .22). */
body.site::after {
  content: ""; position: fixed; inset: 0; z-index: 6; pointer-events: none;
  background:
    radial-gradient(60vw 60vh at 4% 10%, rgba(46, 154, 72, .20), transparent 70%),
    radial-gradient(55vw 65vh at 100% 55%, rgba(63, 190, 94, .14), transparent 70%),
    radial-gradient(75vw 55vh at 40% 110%, rgba(28, 107, 49, .22), transparent 70%);
  mix-blend-mode: screen;
  transform: translateZ(0);
}
@media (max-width: 760px) {
  body.site::after {
    background:
      radial-gradient(110vw 50vh at 0% 8%, rgba(46, 154, 72, .20), transparent 70%),
      radial-gradient(110vw 55vh at 100% 100%, rgba(28, 107, 49, .22), transparent 70%);
  }
}
body.blog-page { background: #080808; }
/* sections that paint their own black let the glow through */
body.site .num { background: rgba(8, 8, 8, .82); }
body.site .num:hover { background: rgba(14, 14, 14, .88); }
.bcard { background: linear-gradient(165deg, rgba(30, 30, 30, .92) 0%, rgba(18, 18, 18, .94) 55%, rgba(12, 12, 12, .96) 100%); }
.bcard:hover { border-color: rgba(147, 211, 162, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 46px 80px -34px rgba(0, 0, 0, 1), 0 0 70px -24px rgba(63, 190, 94, .35); }

/* ---------------------------------------------------------------------
   FOOTER PARALLAX: driven by the browser's own scroll timeline, so it
   moves in step with scrolling (no script, no lag). Browsers without
   scroll timelines simply show the footer still.
   --------------------------------------------------------------------- */
body.site .cp-bottom { margin-top: clamp(50px, 7vw, 90px); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body.site .contact-panel { view-timeline: --foot block; }
    body.site .cp-top { animation: cpTopIn linear both; animation-timeline: --foot; animation-range: entry 0% entry 100%; }
  }
}
@keyframes cpTopIn { from { transform: translate3d(0, -140px, 0); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes cpGlowIn { from { transform: translate(-50%, 45%); opacity: .4; } to { transform: translate(-50%, 0); opacity: 1; } }

/* entrance */
.fx-up { animation: fxUp 1s var(--ease-out, ease) both; }
.fx-d1 { animation-delay: .08s; } .fx-d2 { animation-delay: .16s; } .fx-d3 { animation-delay: .24s; }
@keyframes fxUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   6. RESPONSIVE & REDUCED MOTION
   --------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .bgrid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .jn-in { grid-template-columns: 1fr; }
  .jn-head { position: static; }
}
@media (max-width: 640px) {
  .bgrid, .bgrid.three { grid-template-columns: 1fr; }
  .bcard { --rot: 0deg !important; border-radius: 24px; }
  .bh-nav .hide-sm { display: none; }
  .bh-brand { width: 130px; }
  .bl-search { flex-basis: 100%; }
  .ar-nav { grid-template-columns: 1fr; }
  .ar-nav .next { grid-column: auto; }
  .ar-cover { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bcard, .bc-pin, .bc-cover img { transition: none; }
  .fx-up { animation: none; }
}
