/* Blog — editorial extension of the AITerm product system. */

.bmain {
  --txt: var(--ink);
  --txt-soft: var(--muted);
  --txt-dim: var(--soft);
  --lime: var(--accent);
  --font-m: var(--font-mono);
  --font-d: var(--font-display);
  --font-b: var(--font-body);
  min-height: 100vh;
  padding: calc(66px + var(--ann-h)) 0 0;
}

.blog-rails {
  position: relative;
  border-inline: 1px solid var(--line);
}

/* Index */
.bhero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 630px;
  padding: 115px 48px 105px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.bhero::before,
.bhero::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent 7%, var(--line) 24%, var(--line) 76%, transparent 93%);
}
.bhero::before { left: 25%; }
.bhero::after { right: 25%; }
.bhero-kicker {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 17px;
  color: var(--muted);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: .14em;
}
.bhero-kicker i { height: 1px; background: var(--line); }
.bhero h1 {
  position: relative;
  z-index: 1;
  max-width: 1050px;
  margin-top: 48px;
  font-size: clamp(60px, 8.2vw, 116px);
  line-height: .88;
}
.bhero h1 span { color: var(--ink); }
.bhero p {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-top: 38px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.65;
}

.blist { padding: 100px 44px 118px; }
.blist-head {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  align-items: end;
  gap: 60px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line-strong);
}
.blist-head h2 { margin-top: 15px; font-size: clamp(40px, 5vw, 67px); }
.blist-head > p { max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.bgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid var(--line);
}
.bcard {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .12);
  transition: background-color 260ms ease;
}
.bcard:first-child { grid-column: 1 / -1; }
.bcard-body { display: flex; flex-direction: column; min-height: 340px; padding: 34px; }
.bcard:first-child .bcard-body { min-height: 405px; padding: 44px; }
.bcard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--soft);
  font: 500 10px/1 var(--font-mono);
  letter-spacing: .035em;
  text-transform: uppercase;
}
.bcard-cat {
  padding: 5px 8px;
  color: #506000;
  background: rgba(215,255,40,.42);
  border-radius: 4px;
  font-weight: 600;
}
.bcard h2 { max-width: 760px; margin-top: 40px; font-size: clamp(27px, 3vw, 43px); line-height: 1.04; }
.bcard:not(:first-child) h2 { font-size: clamp(25px, 2.4vw, 34px); }
.bcard p { max-width: 680px; margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.bcard-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  margin-top: auto;
  padding-top: 30px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.bcard-more span { transition: transform 180ms var(--ease-out); }

.bband {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  padding: 88px 64px;
  border-top: 1px solid var(--line);
  background: #151714;
  color: var(--app-text);
}
.bband .eyebrow { color: var(--accent); }
.bband h2 { margin-top: 22px; font-size: clamp(44px, 5.6vw, 76px); }
.bband > div:last-child { align-self: end; }
.bband-sub { max-width: 480px; margin-bottom: 28px; color: #9da198; font-size: 16px; line-height: 1.7; }
.bband small { display: block; margin-top: 16px; color: #6f746c; font: 500 10px/1 var(--font-mono); }

/* Article */
.barticle-wrap { padding: 0 48px 120px; }
.barticle { max-width: 920px; margin: 0 auto; }
.bhead { padding: 72px 0 55px; border-bottom: 1px solid var(--line-strong); }
.bcrumbs {
  display: flex;
  gap: 8px;
  overflow: hidden;
  margin-bottom: 58px;
  color: var(--soft);
  font: 500 10px/1.3 var(--font-mono);
  white-space: nowrap;
}
.bcrumbs span[aria-current] { overflow: hidden; text-overflow: ellipsis; }
.bhead-kicker { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--soft); font: 600 9px/1 var(--font-mono); letter-spacing: .11em; }
.bcat { padding: 6px 8px; color: #526200; background: rgba(215,255,40,.45); border-radius: 4px; }
.barticle h1 { max-width: 900px; margin-top: 28px; font-size: clamp(48px, 7vw, 88px); line-height: .95; }
.bdesc { max-width: 760px; margin-top: 28px; color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.58; }
.bmeta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 31px; color: var(--soft); font: 500 10px/1 var(--font-mono); }
.bmeta > * + *::before { content: "·"; margin-right: 20px; }

.share { display: flex; align-items: center; gap: 7px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.share-label { margin-right: auto; color: var(--soft); font: 600 9px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.share a,
.share button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: transparent; font: 600 11px/1 var(--font-mono); cursor: pointer; }

.prose { padding: 64px 0 75px; color: #292a26; font-size: 17px; line-height: 1.84; }
.prose > * { max-width: 760px; margin-inline: auto; }
.prose .lead { color: var(--ink); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.55; letter-spacing: -.015em; }
.prose p { margin-bottom: 25px; }
.prose h2 { margin-top: 78px; margin-bottom: 25px; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.04; }
.prose h3 { margin-top: 48px; margin-bottom: 17px; font-size: 25px; }
.prose ul,
.prose ol { margin-top: 0; margin-bottom: 30px; padding-left: 23px; }
.prose li { margin: 9px 0; padding-left: 5px; }
.prose a { text-decoration: underline; text-decoration-color: #9aac42; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.45); font: 500 .83em/1.3 var(--font-mono); }
.prose pre { max-width: 820px; margin-top: 30px !important; margin-bottom: 35px !important; border: 1px solid #2b2e29 !important; border-radius: 8px !important; background: #111310 !important; box-shadow: 0 22px 45px -38px rgba(0,0,0,.8); }
.prose pre code { border: 0; background: none; color: #cdd1c8; }
.prose blockquote { margin-block: 35px; padding: 4px 0 4px 26px; border-left: 2px solid var(--ink); color: var(--muted); font-size: 19px; }
.prose figure { max-width: 840px; margin-block: 40px !important; padding: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.32); }
.prose figcaption { margin-top: 14px; color: var(--soft); font-size: 12px; line-height: 1.55; }
.prose > div[style*="overflow-x:auto"] { max-width: 840px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.prose table { color: var(--ink); }
.prose th { color: var(--soft) !important; }
.prose tr { border-bottom: 1px solid var(--line) !important; }
.prose tbody tr:last-child { border-bottom: 0 !important; }
.prose td { color: var(--muted); }
.prose td:first-child { color: var(--ink); }

/* Normalize the older inline article components into the current system. */
.prose > div[style*="grid-template-columns"] { max-width: 840px; gap: 0 !important; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.prose > div[style*="grid-template-columns"] > div { min-height: 170px; padding: 24px !important; border: 0 !important; border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: rgba(255,255,255,.18) !important; }
.prose > div[style*="border-left:3px"] { max-width: 840px; padding: 28px 30px !important; border: 0 !important; border-block: 1px solid var(--line-strong) !important; border-left: 3px solid var(--ink) !important; border-radius: 0 !important; background: rgba(255,255,255,.24) !important; }
.prose [style*="color:#d1fe17"] { color: #647700 !important; }
.prose [style*="rgba(255,255,255"] { border-color: var(--line) !important; }

.bfaq,
.bcta,
.brelated { margin-top: 85px; }
.bfaq > h2,
.brelated > h2 { margin-bottom: 30px; font-size: clamp(36px, 4.5vw, 54px); }
.bfaq .faq-list summary { font-size: 16px; }
.bcta {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 45px;
  padding: 48px;
  border: 1px solid #2b2e29;
  background: #151714;
  color: var(--app-text);
}
.bcta h2 { font-size: clamp(34px, 4vw, 51px); }
.bcta p { align-self: end; color: #9da198; line-height: 1.65; }
.bcta-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.bcta .btn-outline { color: var(--app-text); border-color: rgba(255,255,255,.18); }
.brelated .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.brelated .bcard:first-child { grid-column: auto; }
.brelated .bcard-body { min-height: 330px; padding: 28px; }
.brelated .bcard h2 { font-size: 27px; }

/* Newsletter modal */
.email-modal { position: fixed; z-index: 500; inset: 0; display: grid; place-items: center; padding: 20px; visibility: hidden; opacity: 0; transition: opacity 180ms ease, visibility 180ms; }
.email-modal.open { visibility: visible; opacity: 1; }
.em-backdrop { position: absolute; inset: 0; background: rgba(14,16,12,.62); backdrop-filter: blur(5px); }
.em-panel { position: relative; width: min(520px, 100%); padding: 38px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); box-shadow: 0 30px 80px rgba(0,0,0,.28); transform: translateY(8px) scale(.98); transition: transform 220ms var(--ease-out); }
.email-modal.open .em-panel { transform: none; }
.em-close { position: absolute; top: 14px; right: 14px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; }
.em-panel h2 { margin-top: 15px; font-size: 38px; }
.em-desc { margin-top: 14px; color: var(--muted); line-height: 1.65; }
.em-panel form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 25px; }
.em-panel input { min-width: 0; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: var(--ink); }
.em-error { margin-top: 10px; color: #a12b22; font-size: 12px; }
.em-success-view { text-align: center; }
.em-check { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto; border-radius: 50%; background: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .bcard:hover { background: rgba(255,255,255,.4); }
  .bcard:hover .bcard-more span { transform: translateX(4px); }
  .share a:hover,
  .share button:hover { color: var(--ink); border-color: var(--line-strong); }
}

@media (max-width: 780px) {
  .bmain { padding-top: 66px; }
  .blog-rails { width: calc(100% - 20px); }
  .bhero { min-height: 560px; padding: 88px 20px 75px; }
  .bhero::before { left: 16.666%; }
  .bhero::after { right: 16.666%; }
  .bhero-kicker { gap: 10px; font-size: 8px; }
  .bhero h1 { margin-top: 39px; font-size: clamp(48px, 16vw, 72px); }
  .bhero p { margin-top: 28px; font-size: 16px; }
  .blist { padding: 72px 10px 84px; }
  .blist-head { grid-template-columns: 1fr; gap: 22px; padding: 0 10px 28px; }
  .bgrid,
  .brelated .bgrid { grid-template-columns: 1fr; }
  .bcard:first-child { grid-column: auto; }
  .bcard-body,
  .bcard:first-child .bcard-body { min-height: 330px; padding: 27px 22px; }
  .bcard h2,
  .bcard:not(:first-child) h2 { font-size: 29px; }
  .bband { grid-template-columns: 1fr; gap: 42px; padding: 60px 25px; }
  .barticle-wrap { width: calc(100% - 20px); padding: 0 17px 90px; }
  .bhead { padding: 52px 0 42px; }
  .bcrumbs { margin-bottom: 40px; }
  .bhead-kicker { align-items: flex-start; flex-direction: column; gap: 11px; }
  .barticle h1 { font-size: clamp(43px, 13.5vw, 65px); }
  .bdesc { font-size: 17px; }
  .bmeta { gap: 10px 16px; line-height: 1.4; }
  .bmeta > * + *::before { margin-right: 16px; }
  .prose { padding: 48px 0 58px; font-size: 16px; line-height: 1.78; }
  .prose h2 { margin-top: 62px; font-size: 36px; }
  .prose > div[style*="grid-template-columns"] { display: grid !important; grid-template-columns: 1fr !important; }
  .prose > div[style*="grid-template-columns"] > div { min-height: 0; }
  .prose > div[style*="border-left:3px"] { padding: 23px 20px !important; }
  .prose pre { margin-inline: -8px !important; padding: 16px !important; }
  .prose figure { padding: 12px; }
  .bcta { grid-template-columns: 1fr; gap: 18px; padding: 31px 24px; }
  .bcta-btns { grid-column: auto; margin-top: 12px; }
  .bcta-btns .btn { width: 100%; }
  .brelated .bcard-body { min-height: 300px; }
  .em-panel { padding: 34px 22px 25px; }
  .em-panel form { grid-template-columns: 1fr; }
  .em-panel input { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .bcard,
  .bcard-more span,
  .em-panel { transition: none; }
}
