/* Subpages, rebuilt on the home page's own system.
   Same column, same mono section rules, same hairline rows, same signal.
   Three devices are borrowed and remarried here:
     - dotted leader rows            (remvze.com index)
     - scramble reveal on labels     (dqnamo kitchen, and it echoes the binary wordmark)
     - reading highlight on scroll   (remvze "text highlight on scroll")
   Liquid glass was declined: decorative refraction is not this world. */

/* ---- shared page frame ------------------------------------------------- */
.shell,
.work-logs-page main.shell,
.thoughts-page main.shell,
.built-page main.shell { width: var(--col); margin-inline: auto; max-width: none; }

/* ---- icons ------------------------------------------------------------- */
.icon { width: 16px; height: 16px; flex: none; display: block; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 20px; height: 20px; }

/* ---- page opening ------------------------------------------------------
   The home hero owns the living field; subpages get its quieter sibling: the
   same didone voice and the same action rhythm, at a compact height. */
.page-open { padding: clamp(30px, 5vw, 54px) 0 clamp(22px, 3vw, 34px); }
.page-open h1 {
  margin: 0; max-width: 17ch;
  font: 400 clamp(34px, 5.2vw, 60px)/1.02 "Bodoni Moda", Didot, Georgia, serif;
  letter-spacing: -.02em;
}
.page-open h1 em { font-style: normal; color: var(--signal); }
.page-open .page-lede { margin: 16px 0 0; max-width: 52ch; color: var(--gray); font-size: 15px; }

/* ---- bands, rules and rows (the home system) --------------------------- */
.band { padding-top: clamp(40px, 5.5vw, 72px); }
.rule { display: flex; align-items: center; gap: 16px; padding-bottom: 6px; }
.rule h2 { margin: 0; color: var(--paper); font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; }
.rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule-link {
  order: 3; min-height: 44px; display: inline-flex; align-items: center; gap: 7px;
  padding-left: 10px; color: var(--dim); text-decoration: none;
  font: 400 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase;
  transition: color .2s var(--ease);
}
.rule-link .icon { color: var(--signal); }
.rule-link:hover { color: var(--paper); }

.rows { list-style: none; margin: 10px 0 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }

/* dotted leader row: title, a dotted rule that eats the slack, then the meta.
   The leader is what makes an index read as a document rather than a table. */
.lrow {
  display: flex; align-items: baseline; gap: 12px;
  padding: 17px 12px; margin-inline: -12px; border-radius: 8px;
  color: inherit; text-decoration: none;
  transition: background .22s var(--ease);
}
.lrow:hover { background: rgba(244, 242, 239, .035); }
.lrow-title { font: 400 15px/1.4 Archivo, sans-serif; color: var(--paper); }
.lrow-lead {
  flex: 1 1 auto; min-width: 24px; align-self: center; height: 1px; margin-top: 2px;
  background-image: radial-gradient(circle, var(--dim) 0.9px, transparent 0.9px);
  background-size: 6px 1px; background-repeat: repeat-x; background-position: 0 0;
  opacity: .55; transition: opacity .22s var(--ease);
}
.lrow:hover .lrow-lead { opacity: 1; }
.lrow-meta {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  color: var(--dim); font: 400 11px/1 "JetBrains Mono", monospace;
  letter-spacing: .08em; white-space: nowrap;
}
.lrow-meta .icon { color: var(--dim); transition: color .22s var(--ease); }
.lrow:hover .lrow-meta .icon { color: var(--signal); }
.lrow-tag {
  flex: none; color: var(--dim); font: 400 9.5px/1 "JetBrains Mono", monospace;
  letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px;
}

/* thumbnail row, used where real artwork exists */
.trow {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center; gap: 18px;
  padding: 18px 12px; margin-inline: -12px; border-radius: 8px;
  color: inherit; text-decoration: none;
  transition: background .22s var(--ease);
}
.trow:hover { background: rgba(244, 242, 239, .035); }
.trow-tile { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #141317; }
.trow-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trow-body { display: grid; gap: 5px; min-width: 0; }
.trow-title { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font: 500 15px/1.35 Archivo, sans-serif; }
.trow-note { color: var(--gray); font-size: 13px; line-height: 1.45; }
.trow-meta { display: inline-flex; align-items: center; gap: 7px; color: var(--dim); font: 400 11px/1 "JetBrains Mono", monospace; letter-spacing: .08em; white-space: nowrap; }

/* the tall variant carries a second meta line and a trailing arrow */
.trow--tall { grid-template-columns: 76px minmax(0, 1fr) auto; align-items: start; padding: 22px 12px; }
.trow--tall .trow-tile { width: 76px; height: 76px; }
.trow-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 3px; }
.trow-tile--empty { background: repeating-linear-gradient(135deg, #141317 0 5px, #0F0E12 5px 10px); }
.trow-go { align-self: center; color: var(--dim); transition: transform .3s var(--ease), color .3s var(--ease); }
.trow:hover .trow-go { color: var(--signal); transform: translateX(4px); }
.lrow-tag { display: inline-flex; align-items: center; gap: 6px; }
.lrow-tag--live { color: var(--signal); border-color: rgba(255, 74, 28, .32); }

/* ---- filters ----------------------------------------------------------- */
.pill-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pill-filters button {
  /* 44, not 38. These are real controls, and 38px is under the touch target
     minimum on the one surface where they are used most. */
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--gray); cursor: pointer;
  font: 400 12px/1 "JetBrains Mono", monospace; letter-spacing: .06em;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.pill-filters button:hover { color: var(--paper); border-color: var(--line-hi); }
.pill-filters button[aria-pressed="true"] {
  color: var(--paper); border-color: rgba(255, 74, 28, .45); background: rgba(255, 74, 28, .07);
}
.pill-filters button .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.pill-filters button[aria-pressed="true"] .dot { background: var(--signal); opacity: 1; box-shadow: 0 0 8px rgba(255, 74, 28, .8); }
.count-note { margin: 18px 0 0; color: var(--dim); font: 400 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }

/* ---- scramble reveal ---------------------------------------------------
   The label resolves out of 0/1 noise, which is the footer wordmark's own
   material used at label scale. */
[data-scramble] { font-variant-ligatures: none; }
[data-scramble].is-scrambling { color: var(--dim); }

/* ---- article ----------------------------------------------------------- */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 80;
  background: transparent; pointer-events: none;
}
.read-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, rgba(255, 74, 28, .35), var(--signal));
  transform: scaleX(0); transform-origin: left center;
  will-change: transform;
}

.article-head { padding: clamp(26px, 4vw, 44px) 0 clamp(18px, 2.4vw, 28px); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; color: var(--dim); font: 400 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.article-meta span { display: inline-flex; align-items: center; gap: 7px; }
.article-head h1 {
  margin: 20px 0 0; max-width: 20ch;
  font: 400 clamp(30px, 4.4vw, 52px)/1.06 "Bodoni Moda", Didot, Georgia, serif;
  letter-spacing: -.02em;
}

/* margin-block, not the margin shorthand: the shorthand zeroes the inline
   margins and kills .col's auto-centering when a hero is a direct child of main */
.article-hero { margin-block: clamp(20px, 3vw, 34px) clamp(26px, 3.5vw, 42px); }
.article-hero img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 10px;
}
.article-hero figcaption { margin-top: 10px; color: var(--dim); font: 400 11.5px/1.5 "JetBrains Mono", monospace; }

/* reading highlight: the paragraph in the reader's band sits at full strength,
   the rest recedes. It is a comprehension aid, not decoration, so it never
   moves anything and it is off entirely under reduced motion. */
.article-body :is(p, li) { transition: color .5s var(--ease), opacity .5s var(--ease); }
.article-body.is-tracking :is(p, li) { color: var(--dim); }
.article-body.is-tracking :is(p, li).is-read { color: var(--gray); }
.article-body.is-tracking :is(p, li).is-live { color: var(--paper); }

.article-body { max-width: 68ch; }
.article-body p { font-size: 16.5px; line-height: 1.72; color: var(--gray); }
.article-body h2 {
  margin: 44px 0 12px;
  font: 400 clamp(21px, 2.4vw, 27px)/1.2 "Bodoni Moda", Didot, Georgia, serif;
  letter-spacing: -.01em; color: var(--paper);
}
.article-body h3 { margin: 32px 0 10px; font: 500 16px/1.35 Archivo, sans-serif; color: var(--paper); }
.article-body a { color: var(--paper); text-decoration-color: rgba(255, 74, 28, .55); }
.article-body a:hover { text-decoration-color: var(--signal); }
.article-body blockquote {
  margin: 30px 0; padding: 2px 0 2px 20px;
  border-left: 1px solid rgba(255, 74, 28, .45);
  color: var(--paper); font: 400 18px/1.55 "Bodoni Moda", Didot, Georgia, serif;
}
.article-body img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.article-body figcaption { margin-top: 10px; color: var(--dim); font-size: 12.5px; }

.article-table-scroll {
  width: 100%; margin: 30px 0; overflow-x: auto; overscroll-behavior-inline: contain;
  border-block: 1px solid var(--line); scrollbar-width: thin;
  scrollbar-color: var(--line-hi) transparent;
}
.article-table-scroll:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.article-table-scroll table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.article-table-scroll :is(th, td) { min-width: 128px; padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-table-scroll th { color: var(--signal); font: 500 11px/1.35 "JetBrains Mono", monospace; letter-spacing: .04em; }
.article-table-scroll tr:last-child td { border-bottom: 0; }

.article-foot { margin-top: clamp(40px, 5vw, 64px); }

@media (prefers-reduced-motion: reduce) {
  .article-body.is-tracking :is(p, li),
  .article-body.is-tracking :is(p, li).is-read { color: var(--gray); }
  .article-body :is(p, li) { transition: none; }
}

@media (max-width: 620px) {
  .lrow { flex-wrap: wrap; gap: 6px 10px; }
  .lrow-lead { display: none; }
  .lrow-title { flex: 1 1 100%; }
  .trow { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding-block: 16px; }
  .trow-tile { width: 44px; height: 44px; }
  .trow-meta { grid-column: 2; }
  .trow--tall { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .trow--tall .trow-tile { width: 64px; height: 64px; }
  .trow--tall .trow-go { grid-column: 2; justify-self: start; }
  .trow--tall .trow-sub { gap: 7px 14px; }
  .lrow--static .lrow-meta { width: 100%; max-width: none; text-align: left; line-height: 1.5; white-space: normal; }
  .article-head { padding-top: 22px; }
  .article-meta { gap: 9px 12px; font-size: 10px; line-height: 1.4; }
  .article-head h1 { margin-top: 18px; font-size: clamp(34px, 10.5vw, 44px); }
  .article-table-scroll { width: calc(100vw - 32px); margin-block: 26px; }
  .article-table-scroll table { min-width: 560px; }
  .read-progress { height: 3px; }
  .article-body p { font-size: 16px; }
}

/* ---- page + case meta -------------------------------------------------
   Identity sits below the heading as a meta line. It is never set above it:
   an eyebrow over a heading is a craft-floor ban, not a preference. */
.page-stamp { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--dim); font: 400 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 18px; color: var(--dim); font: 400 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.page-meta span { display: inline-flex; align-items: center; gap: 7px; }
.case-meta { margin-top: 22px; text-transform: none; letter-spacing: .04em; }
.case-meta a { color: var(--paper); text-decoration-color: rgba(255,74,28,.5); }
.case-claim {
  margin: 16px 0 0; max-width: 30ch;
  font: 400 clamp(20px, 2.5vw, 28px)/1.25 "Bodoni Moda", Didot, Georgia, serif;
  letter-spacing: -.015em; color: var(--paper);
}
.case-claim + .article-body { margin-top: 14px; }
.case-back { margin-top: 26px; }
/* a step row states a fact; it is not a link and must not pretend to be one */
.lrow--static { cursor: default; }
.lrow--static:hover { background: none; }
.lrow--static .lrow-meta { white-space: normal; text-align: right; max-width: 46ch; }
.legal-copy p { margin: 14px 0 0; max-width: 68ch; color: var(--gray); font-size: 15.5px; line-height: 1.7; }
.legal-copy a { color: var(--paper); text-decoration-color: rgba(255,74,28,.55); }

/* an index row summarises; it does not reprint the opening paragraph */
.trow-note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Drawn covers are wide diagrams, not photographs. Cropping one to a square
   tile cuts the figure in half, so the tile shows the whole drawing instead
   and sits on the same ground the artwork is drawn on. */
.trow-tile img[src$=".svg"] { object-fit: contain; background: #0B0A0D; }
