/* Lalakai article system — long-form posts (blog-hunter-*.html, training notes).
   A static article system built on the
   Lalakai tokens. Font mapping is deliberate, not 1:1: the source runs a
   grotesk for headings and a serif for prose; here `--font-heading` IS the
   serif and `--font-body` the sans, so article headings use the sans stack
   and prose the serif stack. Loaded only on article pages, after
   lalakai-merge.css. */

/* ------------------------------------------------------- article grid
   11-column internal grid inside <main>. Sections span 7 columns by
   default; wide8 / wide10 / wide11 stretch figures, charts and tables. */

.ll-article {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  padding-top: 1.5rem;
  padding-bottom: 6rem;
  min-width: 0;
}

.ll-article-sec {
  grid-column: 1 / -1;
  min-width: 0;
  scroll-margin-top: 7rem;
}

@media (min-width: 768px) {
  .ll-article {
    padding-top: 4rem;
  }
  .ll-article-sec {
    grid-column: span 7 / span 7;
  }
  .ll-article-sec[data-wide="8"] {
    grid-column: span 8 / span 8;
  }
  .ll-article-sec[data-wide="10"] {
    grid-column: span 10 / span 10;
  }
  .ll-article-sec[data-wide="11"] {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------- article header
   Title, byline row (author left, date right), rule below. */

.ll-article-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.ll-article-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin: 0;
}

/* title entrance: letters rise one by one, the home hero's signature.
   article.js splits [data-title-rise] into spans; without JS the title
   renders plainly. Reduced-motion is handled by the shared guard. */

.ll-article-title .ll-title-letter {
  animation-delay: calc(0.1s + var(--i, 0) * 0.018s);
}

/* word wrappers keep words from breaking mid-word once every letter is
   an inline-block. */

.ll-title-word {
  display: inline-block;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .ll-article-title {
    font-size: 32px;
  }
}

.ll-article-byline {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.12px;
}

.ll-article-byline .ll-byline-author {
  color: var(--color-secondary);
}

.ll-article-byline .ll-byline-date {
  color: var(--color-primary);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .ll-article-byline {
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
  }
  .ll-article-byline .ll-byline-date {
    color: var(--color-secondary);
  }
}

/* ------------------------------------------------------ hero panel
   Fixed-aspect artwork panel. The WebGL scene keeps its own light ground
   in both themes: the panel background is pinned, never themed. */

.ll-article-hero {
  margin: 0 0 2rem;
}

.ll-article-hero-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 829 / 550;
  background: #fbfaf6;
  border: 1px solid var(--color-mono-300);
  border-radius: 16px;
}

/* ---------------------------------------------------------- article voices
   The article's running text uses the site's own display serif, the same face
   the rest of the site sets in `--font-heading`, so the post reads as part of
   Lalakai rather than a borrowed voice. The byline is the one exception: it
   runs in Azeret Mono, a squared mono, so the credit line is clearly set apart
   from the copy. Azeret is declared here, not in the merge bridge, so nothing
   outside the article is affected. */

@font-face {
  font-family: "Lalakai Azeret Mono";
  src: url("../fonts/azeret-mono-400.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.ll-article {
  --article-mono: "Lalakai Azeret Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

/* The byline runs in the article mono. */

.ll-article .ll-article-byline {
  font-family: var(--article-mono);
}

/* ------------------------------------------------------------ prose
   Serif body copy, sans section headings, mono metadata. */

.ll-prose {
  color: var(--color-primary);
}

/* The family ships only Book and Medium, and Book's stems are heavy at body
   size. Thin the letterforms rather than change the face: a hairline stroke in
   the paper colour erodes the outline on both sides of every stem, which takes
   roughly a third of a point off the thickest strokes. Grayscale smoothing
   drops the subpixel weight on top of that, and a slightly lifted ink keeps
   the contrast. Headings are on Book too — size carries the hierarchy. */

.ll-article {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --ll-paper: var(--color-background, #fbfaf6);
}

.ll-prose {
  --ll-body-ink: color-mix(in srgb, var(--color-primary) 84%, var(--color-background));
}

/* the erosion: invisible on its own, it just shaves the stems */
.ll-article .ll-prose p,
.ll-article .ll-list-text,
.ll-article .ll-article-h2,
.ll-article .ll-article-title {
  -webkit-text-stroke: 0.34px var(--ll-paper);
}

.ll-prose p {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: 0.005em;
  color: var(--ll-body-ink);
  margin: 0 0 0.9rem;
}

.ll-prose p:last-child {
  margin-bottom: 0;
}

/* Section headings speak in the Lalakai display voice (serif), not a
   grotesk — with a mono spec index. */

.ll-article-h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin: 2rem 0 0.5rem;
  scroll-margin-top: 7rem;
}

.ll-h2-index {
  margin-right: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -0.12px;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
  vertical-align: 0.35em;
}

.ll-article-h4 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  color: var(--color-primary);
  margin: 1rem 0 0.5rem;
  scroll-margin-top: 7rem;
}

/* heading anchors: the slug link copies its URL on click (see
   article.js); the hash mark appears only while hovering the heading. */

.ll-anchor {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.ll-anchor:hover {
  color: inherit;
}

.ll-anchor-hash {
  margin-left: 0.5rem;
  display: inline-block;
  color: color-mix(in srgb, var(--color-secondary) 50%, transparent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ll-article-h2:hover .ll-anchor-hash,
.ll-article-h4:hover .ll-anchor-hash {
  opacity: 1;
}

/* inline elements: Lalakai quiet links (underline, accent on hover —
   the ll-button-quiet voice) instead of dotted invert links; a brand-blue
   highlighter wash instead of the hatched mark. */

.ll-prose a.ll-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.12s ease;
}

.ll-prose a.ll-link:hover {
  color: var(--color-pri-800);
}

.ll-prose strong {
  font-weight: 600;
}

.ll-hl {
  font-weight: 400;
  text-decoration: none;
  background: color-mix(in srgb, var(--color-pri-800) 14%, transparent);
  border-radius: 3px;
  /* the wash is a block, so it needs its own air on both sides or it reads as
     if the highlighted run and the word after it are touching */
  padding: 0.06em 0.18em;
  margin: 0 -0.02em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

h1 .ll-hl,
h2 .ll-hl,
h3 .ll-hl,
h4 .ll-hl {
  text-decoration: none;
  background: none;
}

.ll-prose code {
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  padding: 0.125rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* a runnable command: set as a block so it never wraps mid-argument */

.ll-prose pre {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--color-mono-300);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-primary) 4%, transparent);
}

.ll-prose pre code {
  padding: 0;
  background: none;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}

.ll-prose em {
  font-style: italic;
}

.ll-ref {
  margin-left: 1px;
  font-size: 0.7em;
  line-height: 1;
}

.ll-ref a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.12s ease;
}

.ll-ref a:hover {
  color: var(--color-pri-800);
  text-decoration: underline;
}

/* ------------------------------------------------------------ lists
   Bulleted lists with 4px round bullets (nestable), mono ordered lists. */

.ll-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.ll-list > li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ll-list-row {
  display: flex;
  gap: 0.75rem;
}

/* bullets are the spark mark in accent — the nav indicator's voice. */

.ll-bullet {
  margin-top: 0.3em;
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border-radius: 0;
  background-color: var(--color-pri-800);
  -webkit-mask: url("../logo/lalakai-mark-small-black.svg?v=1") center / contain no-repeat;
  mask: url("../logo/lalakai-mark-small-black.svg?v=1") center / contain no-repeat;
}

.ll-list-text {
  font-family: var(--font-heading);
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: 0.004em;
  color: var(--ll-body-ink, var(--color-primary));
}

.ll-list-nest {
  padding-left: 1.5rem;
}

.ll-list-nest .ll-list {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.ll-olist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}

.ll-olist > li {
  display: flex;
  gap: 0.75rem;
}

.ll-olist-num {
  margin-top: 1px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- note
   A quiet rounded panel in the site's card voice, not a side rule. */

.ll-note {
  margin: 1.5rem 0;
  border: 1px solid var(--color-mono-300);
  border-radius: 12px;
  padding: 0.875rem 1rem;
}

.ll-note p {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-secondary);
  margin: 0;
}

/* ----------------------------------------------------------- figure
   Borderless figure: optional sans title, full-bleed image, caption. */

.ll-art-figure {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ll-art-figure-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  text-align: left;
  color: var(--color-primary);
}

.ll-art-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.ll-art-figure figcaption {
  font-family: var(--font-heading);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--color-secondary);
}

/* ------------------------------------------------------- math block
   Display equations: horizontal scroll, hidden scrollbars, 15px base. */

.ll-math {
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 15px;
  scrollbar-width: none;
}

.ll-math::-webkit-scrollbar {
  display: none;
}

.ll-math .katex-display {
  margin: 0;
}

/* ------------------------------------------------------- references
   Numbered list with mono [n] labels and anchor targets. */

.ll-refs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

.ll-refs > li {
  display: flex;
  gap: 0.75rem;
  scroll-margin-top: 7rem;
}

.ll-refs-num {
  margin-top: 1px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
}

.ll-refs-text {
  font-family: var(--font-heading);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-secondary);
}

.ll-refs-text a.ll-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.12s ease;
}

.ll-refs-text a.ll-link:hover {
  color: var(--color-pri-800);
}

/* references open with a divider, Lalakai row rhythm. */

.ll-refs-top {
  border-top: 1px solid var(--color-divider-subtle);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

/* ------------------------------------------------------------ chart
   Bordered chart box: title row with inline selects, SVG area, notes. */

.ll-chart {
  width: 100%;
  max-width: 960px;
  border: 1px solid var(--color-mono-300);
  border-radius: 16px;
  padding: 22px 24px 18px 20px;
}

.ll-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 0.75rem;
}

@media (min-width: 768px) {
  .ll-chart-grid {
    grid-template-columns: minmax(0, 1fr) 170px;
  }
}

.ll-chart-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  order: 2;
}

@media (min-width: 768px) {
  .ll-chart-main {
    order: 1;
  }
}

.ll-chart-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  order: 1;
}

@media (min-width: 768px) {
  .ll-chart-aside {
    order: 2;
    padding-left: 0.75rem;
    padding-top: 6px;
  }
}

.ll-chart-label {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: color-mix(in srgb, var(--color-secondary) 60%, var(--color-background));
}

.ll-chart-note {
  max-width: 150px;
  padding-right: 0.5rem;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-secondary);
}

@media (max-width: 767px) {
  .ll-chart-note {
    max-width: none;
  }
}

.ll-chart-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 4px;
  margin: 0 0 0.625rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  color: var(--color-primary);
}

@media (min-width: 768px) {
  .ll-chart-title {
    font-size: 16px;
  }
}

.ll-chart-title .ll-vs {
  font-style: italic;
  color: color-mix(in srgb, var(--color-secondary) 60%, var(--color-background));
}

.ll-chart-title .ll-metric-chip {
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-primary) 5%, transparent);
  border-radius: 999px;
  padding: 0 0.6rem;
  color: var(--color-primary);
}

.ll-select {
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-primary);
  background: var(--color-background);
  border: 1px solid var(--color-mono-400);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.ll-select:hover {
  border-color: var(--color-primary);
}

.ll-chart-svgwrap {
  width: 100%;
  padding: 0.75rem 0;
}

.ll-chart-svgwrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.ll-chart-notes {
  margin-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.875rem;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--color-secondary);
}

.ll-chart-notes p {
  margin: 0 0 0.375rem;
}

.ll-chart-notes p:last-child {
  margin-bottom: 0;
}

.ll-note-lead {
  font-weight: 500;
  color: var(--color-primary);
}

/* ------------------------------------------------------------ table
   Benchmark table: rounded card frame, ours in accent numerals (no
   column wash), hover states on cells, stagger-in rows (see article.js). */

.ll-table-figure {
  margin: 3rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.ll-table-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  color: var(--color-primary);
}

.ll-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-mono-300);
  border-radius: 14px;
}

table.ll-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.ll-table thead tr {
  border-bottom: 1px solid var(--color-border);
}

.ll-table th[scope="col"] {
  padding: 0.625rem 1rem;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--color-primary);
}

.ll-table th[scope="col"].ll-col-first {
  width: 11rem;
  padding-right: 1.25rem;
}

.ll-table th[scope="col"].ll-col-featured {
  color: var(--color-pri-800);
}

.ll-table th[scope="col"] .ll-col-name-featured {
  font-weight: 500;
}

.ll-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.ll-table tbody tr:last-child {
  border-bottom: 0;
}

.ll-table tbody tr.ll-pre {
  opacity: 0;
  transform: translateY(8px);
}

.ll-table th[scope="row"] {
  width: 11rem;
  padding: 0.875rem 1.25rem 0.875rem 0;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--color-primary);
}

.ll-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
  transition: background-color 0.15s ease;
}

.ll-table td.ll-cell-featured {
  color: var(--color-pri-800);
  font-weight: 500;
}

.ll-table td.ll-cell-featured:hover {
  background: color-mix(in srgb, var(--color-pri-800) 8%, transparent);
}

.ll-table tbody tr td:not(.ll-cell-featured):hover {
  background: color-mix(in srgb, var(--color-primary) 4%, transparent);
}

.ll-table .ll-cell-best {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* scatter internals (drawn by article.js): hairline grid, small ticks,
   thin series lines; baselines are hollow dots, ours solid accent. */

.ll-sc-grid {
  stroke: var(--color-border);
  stroke-width: 1;
}

.ll-sc-tick {
  font-family: var(--font-body);
  font-size: 11.5px;
  fill: var(--color-secondary);
}

.ll-sc-axis {
  font-family: var(--font-body);
  font-size: 12px;
  fill: var(--color-secondary);
}

.ll-sc-line {
  stroke: color-mix(in srgb, var(--color-primary) 35%, transparent);
  stroke-width: 1.5;
}

.ll-sc-line-featured {
  stroke: var(--color-pri-800);
  stroke-width: 2;
}

.ll-sc-dot {
  fill: var(--color-background);
  stroke: var(--color-secondary);
  stroke-width: 1.5;
}

.ll-sc-dot-featured {
  fill: var(--color-pri-800);
  stroke: var(--color-pri-800);
}

.ll-sc-label {
  font-family: var(--font-body);
  font-size: 11.5px;
  fill: var(--color-primary);
}

.ll-sc-label-featured {
  font-weight: 500;
  fill: var(--color-pri-800);
}

/* static figure SVGs (hand-authored bars, legends): bars for our models
   in accent, baselines quiet; labels small sans. */

.ll-bar-us {
  fill: var(--color-pri-800);
}

.ll-bar-them {
  fill: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.ll-bar-label {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--color-secondary);
}

.ll-bar-value {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.ll-svg-legend {
  font-family: var(--font-body);
  font-size: 11.5px;
  fill: var(--color-secondary);
}

/* ------------------------------------------------- article footer
   Weights CTAs + back link, mirroring the post's closing block. */

.ll-article-close {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.25rem;
  row-gap: 1rem;
  margin-top: 2.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .ll-anchor-hash {
    transition: none;
  }
  .ll-table tbody tr {
    transition: none;
  }
}

/* ------------------------------------------- hero plate
   Instrument furniture over the artwork: corner registration ticks, a
   score scale, a legend naming the two releases, and a slow scan. The
   panel keeps its own light ground in both themes, so these marks are
   pinned to the hero palette rather than the page tokens. */

.ll-article-hero-frame {
  --hero-ink: #1d3a63;
  --hero-muted: #6d8fc0;
  --hero-accent: #5b93e2;
  --hero-hair: rgba(29, 58, 99, 0.22);
}
