/* ===========================================================================
   insights.css · Insights index
   Structural clone of bond.krd/blog
   Spec: docs/research/pages/insights/ (TOPOLOGY.md, tokens.md, BEHAVIORS.md,
   components/PageTitle|CategoryFilter|PostList|PostRow|DitherCanvas.spec.md)
   Everything is scoped under main.p-insights.

   The source drives every dimension off a fluid root font-size
   (100vw/412*16 below 640, 100vw/768*16 at 640-1023, 100vw/1440*16 at 1024+)
   with --spacing:.0625rem, so a utility like "pt-312" is 312 root units.
   styles.css owns :root, so this page carries its own unit token --u and
   writes every length as calc(N * var(--u)), where N is the px value at 1440.
   At 1440 --u = 1px, the source design width. Same pattern as css/work.css.

   Colour map: source blue #1925aa -> --teal, mercury #e8e6e0 -> --paper.
   =========================================================================== */

main.p-insights{
  --u: calc(100vw / 412);
  --gap: calc(10 * var(--u));
  --pad: calc(15 * var(--u));
  --cols: 6;
  display: block;
  position: relative;
  overflow-x: clip;
  background: var(--paper);
  color: var(--teal);
}
@media (min-width: 640px){
  main.p-insights{ --u: calc(100vw / 768); --gap: calc(12.5 * var(--u)); }
}
@media (min-width: 1024px){
  main.p-insights{ --u: calc(100vw / 1440); --gap: calc(15 * var(--u)); --cols: 12; }
}

/* --- the one section: page grid + gutters (source .px-15 .my-grid) ------- */
main.p-insights section.ins{
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap);
  padding: calc(148 * var(--u)) var(--pad) calc(100 * var(--u));
  align-content: start;
}
@media (min-width: 1024px){
  main.p-insights section.ins{ padding-top: calc(312 * var(--u)); }
}

.p-insights a{ color: inherit; text-decoration: none; }
.p-insights p{ margin: 0; }
.p-insights ul{ list-style: none; margin: 0; padding: 0; }

/* SplitText holders start hidden so the line mask has something to reveal */
body.gsap .p-insights .sp{ opacity: 0; }
body.gsap .p-insights .in-count{ opacity: 0; }
body.gsap .p-insights .in-list{ opacity: 0; }
body:not(.gsap) .p-insights .in-rule i{ transform: none; }

@media (prefers-reduced-motion: reduce){
  body.gsap .p-insights .sp,
  body.gsap .p-insights .in-count,
  body.gsap .p-insights .in-list{ opacity: 1 !important; }
  .p-insights .in-rule i{ transform: none !important; }
  .p-insights .in-fill{ transform: scaleY(0) !important; }
  .p-insights .in-date,
  .p-insights .in-cat,
  .p-insights .in-title,
  .p-insights .in-read,
  .p-insights .in-photo{ transition: none !important; }
}

/* =========================================================================
   1 · PAGE TITLE   (source: h1.page-title + sup + the first hairline rule)
   ========================================================================= */
.p-insights .in-head{ grid-column: 1 / -1; display: block; }
@media (min-width: 1024px){
  .p-insights .in-head{
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: end;
  }
}

.p-insights .in-h1{
  display: flex;
  align-items: flex-start;
  justify-self: start;
  margin: 0;
  grid-column: 1 / 8;
}
.p-insights .page-title{
  font-family: var(--sans);
  font-weight: 500;
  font-size: calc(52 * var(--u));
  line-height: 1;
  /* Instrument Sans sets wider than PP Neue Montreal; pulled back to hold the box */
  letter-spacing: -.025em;
  color: var(--teal);
}
@media (min-width: 1024px){
  .p-insights .page-title{ font-size: calc(160 * var(--u)); line-height: .9375; }
}
.p-insights .in-h1-t{ display: block; }
.p-insights .in-count{
  flex: none;
  align-self: flex-start;
  top: 0;
  vertical-align: baseline;
  margin-left: calc(18 * var(--u));
  font-size: calc(20 * var(--u));
  line-height: 1;
  font-weight: 500;
}
@media (min-width: 1024px){
  .p-insights .in-count{ font-size: calc(30 * var(--u)); }
}

/* the lede is an addition: the source page carries no standfirst */
.p-insights .in-lede{
  grid-column: 8 / 13;
  max-width: 40ch;
  margin-top: calc(24 * var(--u));
}
@media (min-width: 1024px){
  .p-insights .in-lede{ margin-top: 0; margin-bottom: calc(14 * var(--u)); }
}
.p-insights .page-text{
  font-family: var(--sans);
  font-weight: 400;
  font-size: calc(22 * var(--u));
  line-height: 1.25;
  color: var(--teal);
}
@media (min-width: 1024px){
  .p-insights .page-text{ font-size: calc(30 * var(--u)); }
}

/* the hairline: 1px, scaleX from the left on load */
.p-insights .in-rule{
  grid-column: 1 / -1;
  height: 1px;
  margin-top: calc(20 * var(--u));
  transform: translateY(.5px);
  pointer-events: none;
}
@media (min-width: 1024px){
  .p-insights .in-rule{ margin-top: calc(32 * var(--u)); }
}
.p-insights .in-rule i{
  display: block;
  height: 1px;
  border-top: 1px solid var(--teal);
  transform-origin: left center;
  transform: scaleX(0);
}
/* source: a second rule below the filter column, hidden at 1024+ */
.p-insights .in-rule-2{ margin-top: calc(50 * var(--u)); }
@media (min-width: 1024px){
  .p-insights .in-rule-2{ display: none; }
}

/* =========================================================================
   2 · CATEGORY RAIL   (source CategoryFilter, rendered as static labels)
   ========================================================================= */
.p-insights .in-rail{
  grid-column: 1 / -1;
  margin-top: calc(30 * var(--u));
}
@media (min-width: 1024px){
  .p-insights .in-rail{
    grid-column: span 2 / span 2;
    margin-top: calc(40 * var(--u));
  }
}
.p-insights .in-rail-label{
  color: var(--teal);
  opacity: .5;
  font-size: calc(12 * var(--u));
  line-height: 1.33;
  margin-bottom: calc(12 * var(--u));
}
@media (min-width: 1024px){
  .p-insights .in-cats{ position: sticky; top: calc(100 * var(--u)); }
}
.p-insights .in-cat-label{
  display: inline-block;
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0;
  font-size: calc(24 * var(--u));
  line-height: 1.5;
  color: var(--teal);
}
@media (min-width: 1024px){
  .p-insights .in-cat-label{ font-size: calc(22 * var(--u)); line-height: 1.3; }
}

/* =========================================================================
   3 · POST LIST   (source .js-blog-posts; subgrid at 1024+)
   ========================================================================= */
.p-insights .in-list{
  grid-column: 1 / -1;
  display: block;
  position: relative;
}
@media (min-width: 1024px){
  .p-insights .in-list{
    grid-column: span 10 / span 10;
    display: grid;
    grid-template-columns: subgrid;
  }
}

/* --- one row ------------------------------------------------------------ */
.p-insights .in-row{
  position: relative;
  display: block;
  padding: calc(40 * var(--u)) 0 calc(50 * var(--u));
  border-bottom: 1px solid var(--teal);
}
@media (min-width: 1024px){
  .p-insights .in-row{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    padding-bottom: calc(32 * var(--u));
  }
}

/* the hover plate. The source parks it at z-index -1 over a transparent body;
   here the ground is painted on main, so the plate sits at 0 and the row
   content is lifted to 1 instead. */
.p-insights .in-fill{
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--teal);
  transform: scaleY(0);
  transform-origin: 50% 0%;
  pointer-events: none;
}
@media (min-width: 1024px){
  .p-insights .in-fill{ display: block; }
}

.p-insights .in-meta,
.p-insights .in-body,
.p-insights .in-media{ position: relative; z-index: 1; }

/* --- meta: date + category ---------------------------------------------- */
.p-insights .in-meta{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
@media (min-width: 1024px){
  .p-insights .in-meta{
    grid-column: span 3 / span 3;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-left: calc(22 * var(--u));
  }
}
.p-insights .in-date{
  font-family: var(--sans);
  font-weight: 400;
  font-size: calc(30 * var(--u));
  line-height: 1;
  letter-spacing: .05em;
  color: var(--teal);
  transition: color .2s cubic-bezier(.4, 0, .2, 1);
}
.p-insights .in-cat{
  font-size: calc(12 * var(--u));
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--teal);
  transition: color .2s cubic-bezier(.4, 0, .2, 1);
}
@media (min-width: 1024px){
  .p-insights .in-cat{ margin-top: calc(16 * var(--u)); }
}

/* --- body: title + the desktop Read button ------------------------------ */
@media (min-width: 1024px){
  .p-insights .in-body{
    grid-column: span 4 / span 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}
.p-insights .in-title{
  margin: calc(50 * var(--u)) 0 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: calc(18 * var(--u));
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--teal);
  transition: color .2s cubic-bezier(.4, 0, .2, 1);
}
@media (min-width: 1024px){
  .p-insights .in-title{ margin-top: 0; font-size: calc(24 * var(--u)); }
}

/* --- media: dithered thumbnail (+ the mobile Read button) --------------- */
.p-insights .in-media{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: calc(50 * var(--u));
}
@media (min-width: 1024px){
  .p-insights .in-media{
    grid-column: span 3 / span 3;
    justify-self: end;
    align-self: start;
    margin-top: 0;
  }
}
.p-insights .in-thumb{
  position: relative;
  overflow: hidden;
  width: 29.37vw;
  aspect-ratio: 1 / 1;
  background: var(--paper);
}
@media (min-width: 1024px){
  .p-insights .in-thumb{ width: 15.42vw; margin-right: calc(20 * var(--u)); }
}
.p-insights .in-thumb canvas{
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  image-rendering: pixelated;
}
/* the hover reveal: the dithered plate crossfades to the photograph */
.p-insights .in-photo{
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
}

/* --- the Read button ---------------------------------------------------- */
.p-insights .in-read{
  position: relative;
  display: none;
  overflow: hidden;
  flex: none;
  margin-top: calc(90 * var(--u));
  padding: calc(31 * var(--u)) calc(50 * var(--u));
  background: var(--paper);
  border: 1px solid var(--paper);
  opacity: 0;
  transition: opacity .2s cubic-bezier(.4, 0, .2, 1);
}
@media (min-width: 1024px){
  .p-insights .in-read{ display: block; }
}
.p-insights .in-read-m{
  display: block;
  margin-top: 0;
  padding: calc(22 * var(--u)) calc(39 * var(--u));
  border-color: var(--teal);
  opacity: 1;
}
@media (min-width: 1024px){
  .p-insights .in-read-m{ display: none; }
}
.p-insights .in-read-t,
.p-insights .in-read-sweep > span{
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: calc(14 * var(--u));
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.p-insights .in-read-m .in-read-t,
.p-insights .in-read-m .in-read-sweep > span{ font-size: calc(11 * var(--u)); }
.p-insights .in-read-t{ color: var(--teal); }
.p-insights .in-read-sweep{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: var(--paper);
  transform: translateY(101%) scaleX(.5);
  transform-origin: 50% 100%;
}
.p-insights .in-read:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: calc(4 * var(--u));
}

/* --- row hover state (1024+ only, exactly as in the source) ------------- */
@media (min-width: 1024px){
  .p-insights .in-row.is-on .in-date,
  .p-insights .in-row.is-on .in-cat,
  .p-insights .in-row.is-on .in-title{ color: var(--paper); }
  .p-insights .in-row.is-on .in-read{ opacity: 1; }
}
