/* ==========================================================================
   APPLICATION NOTES — index page.
   Mirrors the typographic system of the printed notes: mono kicker, display
   title with the second clause in accent, author rule, numbered stat blocks.
   ========================================================================== */

/* ---- page header --------------------------------------------------------- */
.notes-hero {
  background: var(--hp-ink);
  padding: clamp(132px, 16vw, 190px) 0 clamp(56px, 8vw, 88px);
  border-bottom: 1px solid var(--border-1);
}
.notes-hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.02; letter-spacing: -0.03em;
  margin: 22px 0 0; color: var(--fg-1);
}
.notes-hero-sub {
  font-family: var(--font-body); font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55; color: var(--fg-2); margin: 22px 0 0;
  max-width: 54ch; text-wrap: pretty;
}

/* ---- list ---------------------------------------------------------------- */
.note-list { list-style: none; margin: 0; padding: 0; counter-reset: note; }
.note-list > .note + .note {
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--border-1);
}

.note-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1.1; letter-spacing: -0.025em;
  margin: 18px 0 0; max-width: 26ch; text-wrap: balance;
}
.note-title .accent { color: var(--accent); }

.note-authors {
  font-family: var(--font-body); font-size: 14px; line-height: 1.6;
  color: var(--fg-3); margin: 18px 0 0; max-width: 70ch;
}

.note-summary {
  font-family: var(--font-body); font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.65; color: var(--fg-2); margin: 26px 0 0;
  max-width: 68ch; text-wrap: pretty;
}

.note-sub {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3);
  margin: 40px 0 0;
}

/* ---- key-result blocks (echo the PDF's four-card grid) ------------------- */
.note-results {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--border-1);
  border: 1px solid var(--border-1);
}
.note-results > li {
  background: var(--bg-surface);
  padding: 24px 26px;
}
.note-results .stat {
  display: block; font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500; line-height: 1; color: var(--accent);
  letter-spacing: -0.02em;
}
.note-results .stat sub { font-size: 0.55em; letter-spacing: 0; }
.note-results .stat-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3);
  margin-top: 10px;
}
.note-results p {
  font-family: var(--font-body); font-size: 14px; line-height: 1.55;
  color: var(--fg-2); margin: 12px 0 0;
}
@media (max-width: 760px){
  .note-results { grid-template-columns: 1fr; }
}

/* ---- method summary ------------------------------------------------------ */
.note-meta {
  margin: 32px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px clamp(24px, 4vw, 56px);
}
.note-meta > div { border-top: 1px solid var(--border-1); padding-top: 12px; }
.note-meta dt {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-3);
}
.note-meta dd {
  font-family: var(--font-body); font-size: 14.5px; line-height: 1.5;
  color: var(--fg-1); margin: 7px 0 0;
}
@media (max-width: 620px){
  .note-meta { grid-template-columns: 1fr; }
}

/* ---- actions ------------------------------------------------------------- */
.note-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px; margin-top: 32px;
}
.note-filesize { font-size: 11.5px; color: var(--fg-3); letter-spacing: 0.04em; }

/* a button-shaped placeholder for an asset that is not published yet */
.btn.is-disabled {
  cursor: default; pointer-events: none; opacity: 0.42;
  background: transparent; color: var(--fg-3); border-color: var(--border-1);
}

.note-title a { color: inherit; }
.note-title a:hover .accent,
.note-title a:hover { color: var(--accent); }

/* ==========================================================================
   INDIVIDUAL NOTE PAGE
   ========================================================================== */

.note-page-hero {
  background: var(--hp-ink);
  padding: clamp(122px, 15vw, 172px) 0 clamp(44px, 6vw, 72px);
  border-bottom: 1px solid var(--border-1);
}
.note-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: 26px;
}
.note-breadcrumb a { color: var(--fg-3); }
.note-breadcrumb a:hover { color: var(--accent); }
.note-page-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.06; letter-spacing: -0.03em;
  margin: 18px 0 0; max-width: 22ch; text-wrap: balance;
}
.note-page-title .accent { color: var(--accent); }

/* article body ------------------------------------------------------------- */
.note-body { max-width: 74ch; }
.note-body h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.15; letter-spacing: -0.025em;
  margin: clamp(56px, 7vw, 84px) 0 0;
  display: flex; gap: 16px; align-items: baseline;
}
.note-body > h2:first-child { margin-top: 0; }
.note-body h2 .num {
  font-family: var(--font-mono); font-size: 0.62em; font-weight: 500;
  color: var(--accent); letter-spacing: 0.02em; flex: none;
}
.note-body h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.3;
  letter-spacing: -0.015em; margin: 40px 0 0; color: var(--fg-1);
}
.note-body p {
  font-family: var(--font-body); font-size: 16px; line-height: 1.7;
  color: var(--fg-2); margin: 18px 0 0; text-wrap: pretty;
}
.note-body h2 + p, .note-body h3 + p { margin-top: 16px; }
.note-body strong { color: var(--fg-1); font-weight: 600; }
.note-body ul { margin: 16px 0 0; padding-left: 0; list-style: none; }
.note-body ul li {
  position: relative; padding-left: 22px; margin-top: 9px;
  font-family: var(--font-body); font-size: 15.5px; line-height: 1.62; color: var(--fg-2);
}
.note-body ul li::before {
  content: ""; position: absolute; left: 2px; top: 0.68em;
  width: 5px; height: 5px; background: var(--accent); border-radius: 50%;
}
.note-body .lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.6; color: var(--fg-1);
}

/* figures ------------------------------------------------------------------ */
.note-fig { margin: 34px 0 0; }
/* figures break out of the 74ch measure to the full container width */
.note-fig.wide, .note-figs-2 {
  width: min(calc(100vw - 64px), calc(var(--container) - 64px));
  max-width: none;
}
.note-fig img {
  display: block; width: 100%; height: auto;
  background: var(--hp-bone); border: 1px solid var(--border-1);
}
.note-fig figcaption {
  font-family: var(--font-body); font-size: 13px; line-height: 1.55;
  color: var(--fg-3); margin-top: 12px; max-width: 84ch;
}
.note-fig figcaption .fig-n {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px;
}
.note-fig figcaption em { color: var(--fg-2); }
.note-figs-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 34px); margin-top: 34px;
}
.note-figs-2 .note-fig { margin-top: 0; }
@media (max-width: 720px){ .note-figs-2 { grid-template-columns: 1fr; } }

/* process-flow timeline (AN-002 Figure 1) ---------------------------------- */
.flow {
  --flow-gap: clamp(12px, 2vw, 28px);
  --rail-off: color-mix(in srgb, var(--hp-ink) 20%, transparent);
  display: grid; grid-template-columns: repeat(4, 1fr);
  column-gap: var(--flow-gap);
  padding: clamp(24px, 3vw, 40px) clamp(16px, 2vw, 32px) clamp(20px, 2.5vw, 32px);
  border: 1px solid var(--border-1); background: var(--hp-bone);
}
/* each column carries its own slice of the rail, so the whole thing stacks
   cleanly on narrow screens */
.flow-col { display: grid; grid-template-rows: 1fr auto auto auto; }

.flow-art {
  display: flex; align-items: flex-end; justify-content: center;
  min-height: clamp(96px, 12vw, 148px); padding-bottom: 14px;
}
.flow-art img {
  display: block; width: auto; max-width: 100%;
  max-height: clamp(96px, 12vw, 148px); border: 0; background: none;
}
.flow-lattice { display: block; width: clamp(62px, 7vw, 96px); height: auto; }

.flow-day {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(13px, 1.4vw, 17px);
  letter-spacing: -0.01em; color: var(--accent); text-align: center;
  padding-bottom: 14px; min-height: 1.2em;
}

.flow-rail { position: relative; height: 20px; margin-bottom: 18px; }
.flow-rail::before, .flow-rail::after {
  content: ""; position: absolute; top: 50%; height: 3px;
  transform: translateY(-50%); background: var(--accent);
}
.flow-rail::before { left: calc(-0.5 * var(--flow-gap) - 2px); right: 50%; }
.flow-rail::after  { left: 50%; right: calc(-0.5 * var(--flow-gap) - 2px); }
/* the pre-Day-0 leg is inactive, and the rail does not run past either end */
.flow-col:first-child .flow-rail::before { background: none; }
.flow-col:first-child .flow-rail::after,
.flow-col:nth-child(2) .flow-rail::before { background: var(--rail-off); }
.flow-col:last-child .flow-rail::after { background: none; }

.rail-dot {
  position: absolute; top: 50%; left: 50%; width: 18px; height: 18px;
  border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--hp-bone); border: 3px solid var(--rail-off);
}
.rail-dot.on { border-color: var(--accent); }

.flow-step { text-align: center; }
.flow-step h4 {
  font-family: var(--font-body); font-weight: 600;
  font-size: clamp(13px, 1.3vw, 15px); line-height: 1.3;
  color: var(--fg-1); margin: 0;
}
.flow-step p {
  font-family: var(--font-body); font-size: clamp(12px, 1.2vw, 14px);
  line-height: 1.45; color: var(--fg-2); margin: 6px 0 0; text-wrap: pretty;
}

@media (max-width: 700px){
  .flow { grid-template-columns: 1fr; row-gap: 4px; }
  .flow-col {
    grid-template-columns: 96px 1fr; grid-template-rows: auto auto;
    align-items: center; column-gap: 18px;
    padding: 16px 0; border-top: 1px solid var(--border-1);
  }
  .flow-col:first-child { border-top: 0; padding-top: 0; }
  .flow-art { grid-row: 1 / 3; min-height: 0; padding: 0; }
  .flow-art img { max-height: 82px; }
  .flow-day { text-align: left; padding-bottom: 0; min-height: 0; }
  .flow-day:empty { display: none; }
  .flow-rail { display: none; }
  .flow-step { text-align: left; }
}

/* native tables ------------------------------------------------------------ */
.note-table-wrap {
  width: min(calc(100vw - 64px), calc(var(--container) - 64px));
  max-width: none; margin: 34px 0 0; overflow-x: auto;
}
.note-table {
  border-collapse: collapse; width: 100%; min-width: 520px;
  font-family: var(--font-body); font-size: 14.5px;
}
.note-table caption {
  caption-side: top; text-align: left;
  font-size: 13px; line-height: 1.55; color: var(--fg-3);
  margin-bottom: 14px; max-width: 84ch;
}
.note-table caption .fig-n {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px;
}
.note-table caption strong { color: var(--fg-2); }
.note-table thead th {
  background: var(--hp-ink); color: var(--hp-bone);
  font-weight: 500; text-align: left; padding: 14px 18px;
  font-size: 13.5px; line-height: 1.35; vertical-align: bottom;
}
.note-table tbody td, .note-table tbody th {
  padding: 13px 18px; color: var(--fg-2); text-align: left;
  border-bottom: 1px solid var(--border-1);
}
.note-table tbody th { color: var(--fg-1); font-weight: 600; }
.note-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--hp-ink) 4%, transparent); }
.note-table .mono { font-family: var(--font-mono); font-size: 13.5px; }

/* references --------------------------------------------------------------- */
.note-refs { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: ref; }
.note-refs li {
  font-family: var(--font-body); font-size: 14px; line-height: 1.6;
  color: var(--fg-3); padding: 12px 0 12px 0; margin-top: 0;
  padding-left: 0; border-top: 1px solid var(--border-1);
}
.note-refs li::before { content: none; }
.note-refs li em { color: var(--fg-2); }
.note-refs a { color: var(--fg-link); word-break: break-word; }

/* sticky download rail ----------------------------------------------------- */
.note-download {
  margin-top: clamp(56px, 7vw, 84px); padding: 26px 28px;
  border: 1px solid var(--border-1); background: var(--bg-surface);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.note-download p {
  margin: 0; flex: 1 1 240px; font-family: var(--font-body);
  font-size: 14.5px; line-height: 1.55; color: var(--fg-2);
}
