/* ============================================================
   /companies: "Glass Index" (9 Nov 2026, his pick "A" of three previews, with his changes: glass cards all one
   size, smaller than the preview's shelves, a long name cut with an ellipsis; A's compact rows on a phone, glossy,
   the name trimmed). Loaded by /companies only (COMPANY_INDEX_ASSETS in src/pages.js), after styles.css, page.css,
   tabbar.css and glass.css: every token (--bg, --card, --ink, --live, the --lg-* glass materials, --ease-out,
   --snap, --spring) is the site's. Motion is never switched off (his rule); hover only lights the glass, never lifts.
   ============================================================ */

/* One offset only (the page's scroll padding): a section's own scroll-margin on top of it counted twice. */
:root:has(main.cd) { scroll-padding-top: calc(var(--bar-h) + 92px); }
@media (max-width: 900px) {
  :root:has(main.cd) { scroll-padding-top: calc(var(--bar-h) + 8px); }
  html.has-tabbar:has(main.cd) { scroll-padding-bottom: calc(var(--tb-h) + 44px + env(safe-area-inset-bottom)); }
}

.cd { padding-top: 18px; }
.cd .crumbs { margin-bottom: 12px; }
.cd-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cd-n { display: inline-block; font-variant-numeric: tabular-nums; }
.cd a, .cd button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ---------- hero ---------- */
.cd-hero { margin: 0 0 18px; }
.cd .cd-hero h1 { margin: 0 0 6px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; text-wrap: balance; }
.cd-lede { margin: 0; max-width: 66ch; font-size: 16px; line-height: 1.5; color: var(--ink-15); text-wrap: pretty; }

/* ---------- the glass bar and its controls ---------- */
.cd-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cd-bar.is-pending { visibility: hidden; }
.cd-bar-glass { display: none; }
.cd-find {
  position: relative; flex: 1 1 260px; min-width: 0;
  display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 6px 0 15px;
  border-radius: var(--r-pill); color: var(--ink-3);
  background: var(--lg-ctl); border: .5px solid var(--lg-rim);
  box-shadow: inset 1px 1px 0 -.5px var(--lg-hi), inset -1px -1px 0 -.5px var(--lg-lo);
  transition: border-color .16s, background-color .16s;
}
.cd-find:focus-within { border-color: var(--rule-2); background: color-mix(in oklab, var(--card) 70%, var(--lg-ctl)); }
.cd-find:has(:focus-visible) { outline: 2px solid var(--live); outline-offset: 2px; }
.cd-find input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 15px; color: var(--ink); }
.cd-find input::placeholder { color: var(--ink-3); }
.cd-find input::-webkit-search-cancel-button { display: none; }
.cd-ic { flex: none; }
.cd-clear {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .16s, color .16s, scale .35s var(--spring);
}
.cd-clear:active { scale: .9; transition-duration: .1s; }
@media (hover: hover) and (pointer: fine) { .cd-clear:hover { background: var(--lg-hover); color: var(--ink); } }

.cd-seg { flex: none; display: flex; gap: 2px; padding: 3px; height: 44px; border-radius: var(--r-pill); border: .5px solid var(--lg-rim); background: var(--lg-well); }
.cd-seg > [role="tab"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: transparent; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  -webkit-user-select: none; user-select: none;
}
.cd-seg > [role="tab"] b { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cd-seg > [role="tab"][aria-selected="true"] { background: var(--card-2); color: var(--ink); }
.cd-seg > [role="tab"][aria-selected="true"] b { color: var(--ink-15); }
@media (hover: hover) and (pointer: fine) { .cd-seg > [role="tab"]:hover { color: var(--ink); } }

.cd-status { margin: 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* The crest: the site's logo plate (initials under, logo over, white plate, contain). */
.cd-crest {
  width: 40px; height: 40px; flex: none; position: relative; overflow: hidden; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--rule); display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--ink-3);
}
.cd-crest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.cd-name { font-size: 15px; font-weight: 600; line-height: 1.28; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.cd-meta { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.cd-chev {
  flex: none; width: 16px; height: 16px; color: var(--ink-3); background: currentColor; transition: color .16s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.cd-empty { margin-top: 16px; padding: 26px 22px; border-radius: var(--r-2); background: var(--card); border: 1px solid var(--rule); }
.cd-empty-t { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--ink); }
.cd-empty-s { margin: 0 0 16px; font-size: 14.5px; color: var(--ink-15); }
.cd-reset {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  border: 1px solid var(--rule-2); background: var(--card-2); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .16s, background-color .16s, scale .35s var(--spring);
}
.cd-reset:active { scale: .97; transition-duration: .1s; }

/* The floating bar: frost on its own layer above 900px, a soft shadow only while it floats. */
@media (min-width: 901px) {
  .cd-a .cd-bar { position: sticky; top: calc(var(--bar-h) + 10px); z-index: 30; margin: 0 -12px; padding: 10px 12px; border-radius: 26px; }
  .cd .cd-bar-glass {
    display: block; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: color-mix(in oklab, var(--bg) 74%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(var(--lg-sat)); backdrop-filter: blur(22px) saturate(var(--lg-sat));
    box-shadow: inset 0 0 0 .5px var(--lg-rim), inset 1px 1px 0 -.5px var(--lg-hi);
    transition: box-shadow .3s var(--ease-out);
  }
  .cd-bar.is-stuck .cd-bar-glass { box-shadow: inset 0 0 0 .5px var(--lg-rim), inset 1px 1px 0 -.5px var(--lg-hi), 0 14px 30px -18px rgba(0, 0, 0, .6); }
  .cd .cd-bar .cd-find { flex: 0 1 400px; }
  .cd-a .cd-bar .cd-status { margin-left: auto; padding-right: 6px; }
}
@media (max-width: 900px) {
  .cd .cd-bar { gap: 8px; }
  .cd .cd-bar .cd-find { flex: 1 1 100%; }
  .cd-a .cd-seg { flex: 1 1 100%; }
  .cd-a .cd-seg > [role="tab"] { flex: 1 1 0; padding: 0 8px; }
  .cd .cd-bar .cd-status { flex: 1 1 100%; }
}

/* ---------- the index ---------- */
.cd-index { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 18px; margin-top: 14px; }
.cd-letters { min-width: 0; }
.cd-l { margin: 0 0 18px; }
.cd-lh {
  position: sticky; top: calc(var(--bar-h) + 84px); z-index: 2; margin: 0 0 8px; display: block;
  font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink); pointer-events: none;
}
.cd-lh span {
  display: inline-grid; place-items: center; min-width: 36px; height: 30px; padding: 0 10px; border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--bg-2) 82%, transparent); border: .5px solid var(--lg-rim);
  -webkit-backdrop-filter: blur(10px) saturate(var(--lg-sat)); backdrop-filter: blur(10px) saturate(var(--lg-sat));
  box-shadow: inset 1px 1px 0 -.5px var(--lg-hi);
}
/* A's companies (his asks 9 Nov: first "a but with cards like this ... all cards same size ... long name then ...",
   then "remove the background fully keep small barely visible lines to separate"): cells of ONE size above 640px with
   no fill, no rim and no shadow, only faint lines BETWEEN them (each cell draws its left and top line; the grid clips
   the ones on its outer edge, so nothing frames the block); the name on one line with an ellipsis (the full name on
   hover, company-index.js). A's compact rows on a phone, the same faint line between rows and no panel. */
.cd { --cd-line: color-mix(in oklab, var(--ink) 8%, transparent); }
:root[data-theme="light"] .cd { --cd-line: color-mix(in oklab, var(--ink) 10%, transparent); }
.cd-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 0; overflow: clip; }
.cd-li { min-width: 0; box-shadow: -1px 0 0 0 var(--cd-line), 0 -1px 0 0 var(--cd-line); }
.cd-row {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "crest . chev" "name name name" "num num num" "meta meta meta";
  height: 160px; padding: 15px 14px 14px 16px; row-gap: 5px; column-gap: 8px;
  text-decoration: none; color: var(--ink); background: none;
  transition: transform .5s var(--spring);
}
/* The hover surface: a soft tile inside the cell, never a fill that meets the lines. */
.cd-row::before {
  content: ""; position: absolute; inset: 5px; z-index: -1; pointer-events: none; border-radius: 12px;
  background: transparent; transition: background-color .2s;
}
.cd-row > .cd-crest { grid-area: crest; width: 44px; height: 44px; border-radius: 12px; }
.cd-row > .cd-crest img { padding: 5px; }
.cd-row .cd-chev { grid-area: chev; align-self: start; margin-top: 2px; }
.cd-row-t { display: contents; }
.cd-a .cd-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-row .cd-name { grid-area: name; margin-top: 6px; }
.cd-num { grid-area: num; align-self: end; display: flex; align-items: baseline; gap: 5px; }
.cd-num .cd-n { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.cd-n-l { font-size: 12.5px; color: var(--ink-2); }
.cd-row .cd-meta { grid-area: meta; min-width: 0; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cd-row.is-quiet .cd-meta { color: var(--ink-3); align-self: end; }
.cd-row:active { transform: scale(.97); transition: transform .12s var(--snap); }
/* Inside the cell: the grid clips anything past its outer edge. */
.cd-row:focus-visible { outline: 2px solid var(--live); outline-offset: -4px; border-radius: 14px; }
@media (hover: hover) and (pointer: fine) {
  /* Hover brightens a soft surface inside the cell; nothing moves. */
  .cd-row:hover::before { background: color-mix(in oklab, var(--ink) 5%, transparent); }
  .cd-row:hover .cd-chev { color: var(--ink); }
}
/* The letter rail: a glass capsule you can press and slide along; the lens marks the letter in view. */
.cd-az {
  position: sticky; top: calc(var(--bar-h) + 96px); align-self: start; z-index: 5; isolation: isolate;
  display: flex; flex-direction: column; align-items: stretch; padding: 5px 3px; border-radius: 18px;
  background: color-mix(in oklab, var(--bg-2) 72%, transparent); border: .5px solid var(--lg-rim);
  -webkit-backdrop-filter: blur(14px) saturate(var(--lg-sat)); backdrop-filter: blur(14px) saturate(var(--lg-sat));
  box-shadow: inset 1px 1px 0 -.5px var(--lg-hi), inset -1px -1px 0 -.5px var(--lg-lo), 0 10px 26px -18px rgba(0, 0, 0, .6);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: ns-resize;
}
.cd-az > a, .cd-az > span:not(.cd-az-lens) {
  position: relative; z-index: 1; display: grid; place-items: center; height: 19px; border-radius: 8px;
  font-family: var(--ui); font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  transition: color .2s var(--ease-out), scale .3s var(--spring);
}
.cd-az > span.is-none { color: color-mix(in oklab, var(--ink-3) 55%, transparent); font-weight: 500; }
.cd-az > a.is-on { color: var(--ink); }
.cd-az > a.is-off { color: color-mix(in oklab, var(--ink-3) 55%, transparent); }
.cd-az > a:focus-visible { outline: 2px solid var(--live); outline-offset: 0; }
.cd-az-lens {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 9px; opacity: 0;
  background: var(--lg-lens);
  box-shadow: inset 0 0 0 .5px var(--lg-rim), inset 1px 1.5px 0 -.5px var(--lg-lens-hi), inset -1px -1px 0 -.5px var(--lg-lo), var(--lg-lens-shade);
  transition: opacity .2s ease;
}
.cd-az.has-ind > .cd-az-lens { opacity: 1; }
.cd-az.is-scrub > a { scale: 1; }
/* The bubble that names the letter under the finger while scrubbing. */
.cd-bubble {
  position: fixed; left: 0; top: 0; z-index: 70; width: 68px; height: 68px; pointer-events: none; opacity: 0; scale: .85;
  display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in oklab, var(--bg-2) 70%, transparent); border: .5px solid var(--lg-rim);
  -webkit-backdrop-filter: blur(16px) saturate(var(--lg-sat)); backdrop-filter: blur(16px) saturate(var(--lg-sat));
  box-shadow: inset 1px 1.5px 0 -.5px var(--lg-hi), inset -1px -1px 0 -.5px var(--lg-lo), 0 18px 40px -16px rgba(0, 0, 0, .6);
  transition: opacity .18s var(--ease-out), scale .35s var(--spring);
}
.cd-bubble.is-up { opacity: 1; scale: 1; }
.cd-bubble span { font-family: var(--display); font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }

@media (max-width: 900px) {
  .cd-index { grid-template-columns: minmax(0, 1fr); gap: 0; padding-right: 22px; }
  .cd-row:focus-visible { outline-offset: -3px; border-radius: 12px; }
  .cd-lh { top: calc(var(--bar-h) + 8px); }
  .cd-az {
    position: fixed; right: max(2px, env(safe-area-inset-right)); top: 50%; translate: 0 -50%; z-index: 40; padding: 4px 1px; border-radius: 14px; width: 22px;
    transition: opacity .25s var(--ease-out), transform .45s var(--spring);
  }
  .cd-az.is-away { opacity: 0; transform: translateX(14px); pointer-events: none; }
  .cd-az > a, .cd-az > span:not(.cd-az-lens) { height: 17px; font-size: 10px; }
}

@media (max-width: 640px) {
  .cd-rows { grid-template-columns: minmax(0, 1fr); }
  .cd-li { box-shadow: 0 -1px 0 0 var(--cd-line); }
  .cd-row {
    height: auto; min-height: 60px; padding: 9px 2px 9px 0; gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-rows: auto; grid-template-areas: none; align-items: center;
  }
  .cd-row::before { inset: 2px -6px; border-radius: 12px; }
  .cd-row > .cd-crest { grid-area: auto; width: 40px; height: 40px; border-radius: 10px; }
  .cd-row-t { display: grid; gap: 2px; min-width: 0; }
  .cd-row .cd-name { grid-area: auto; margin: 0; }
  /* One line on a phone too, so every row is the same height; the company page names the rest. */
  .cd-row .cd-meta { grid-area: auto; display: block; -webkit-line-clamp: unset; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cd-num { grid-area: auto; align-self: center; }
  .cd-num .cd-n { font-size: 19px; letter-spacing: -.02em; }
  .cd-n-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cd-row .cd-chev { grid-area: auto; grid-column: 4; align-self: center; margin: 0; }
  .cd-row:active { transform: none; transition: none; }
  .cd-row:active::before { background: color-mix(in oklab, var(--ink) 7%, transparent); transition-duration: .06s; }
}
