/* Catalog pages (/hands, /gloves, /compare). Built only from styles.css tokens, so
   the light/dark toggle (html[data-theme]) and the system preference both switch
   it with no theme rules of its own; add any future dark-only rule in both the
   :root:not([data-theme="light"]) media form and the :root[data-theme="dark"] form. Product photos are baked on white and multiplied
   onto var(--tile), which stays light in both themes. */
:root {
  --plate: color-mix(in srgb, var(--tile, #ebe9e3) 45%, #fff);
  --plate-ink: #4a4b48;                                   /* sits on --plate, light in both themes */
  --tile-bg: var(--tile, #ebe9e3);
  --ok: color-mix(in srgb, #4f9d72 72%, var(--text));     /* darker on light, lighter on dark */
  --display: var(--serif, "Instrument Serif", Georgia, serif);
}

/* Mono label: the one small-caps voice for data */
.lw-count, .pstat, .fig-k, .cmp .k, .cmp-head, .cmpx-k {
  font-family: var(--mono); font-size: .68rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: .12em;
}

/* Brand plate: marks tinted to one ink so the wall reads calm; colour on hover */
.plate {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--plate); border-radius: var(--radius); overflow: hidden;
}
.plate img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain;
  filter: grayscale(1) contrast(1.05); opacity: .78; transition: filter .3s, opacity .3s;
}
a:hover .plate img { filter: none; opacity: 1; }
.plate.wordmark {
  font-family: var(--mono); font-weight: 500; color: var(--plate-ink);
  text-transform: uppercase; letter-spacing: .1em; text-align: center; line-height: 1.15;
}
.plate.wall   { width: 100%; height: 76px; padding: 16px 20px; }
.plate.wall.wordmark { font-size: .72rem; }
.plate.lg     { width: 52%; height: 34%; padding: 14px 20px; }
.plate.lg.wordmark { font-size: .9rem; }
.plate.xs     { width: 76px; height: 28px; padding: 4px 6px; }
.plate.xs.wordmark { font-size: .48rem; letter-spacing: .04em; }
.plate.thumb  { width: 100%; height: 100%; padding: 6px; border-radius: 0; background: transparent; }
.plate.thumb.wordmark { font-size: .46rem; }

/* Logo wall: hairline grid, no boxes */
.catalog-hero { padding-bottom: 48px; }
.logo-wall {
  display: grid; margin-top: 36px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  border-top: 1px solid var(--border); border-left: 1px solid var(--border);
}
.logo-wall a {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 14px 12px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: background .25s;
}
.logo-wall a:hover { background: var(--surface); }
.lw-name { font-size: .86rem; font-weight: 500; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-count { color: var(--muted); margin-top: -6px; }
@media (max-width: 480px) {
  .logo-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .logo-wall a { padding: 10px 8px; gap: 8px; }
  .plate.wall { height: 54px; padding: 9px 8px; }
  .lw-name { font-size: .76rem; }
}

/* Logo-wall target: sits at the top of each brand's first card */
.brand-anchor { position: absolute; top: 0; scroll-margin-top: 84px; }

/* Product grid: photo, name, status, one button */
.catalog-grid { padding: 56px 0 8px; }
.pgrid { display: grid; gap: 48px 24px; grid-template-columns: 1fr; }
@media (min-width: 360px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 860px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 84px; }
.pcard-media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--tile-bg); border-radius: var(--radius);
}
.pcard-media > img {
  display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.pcard:hover .pcard-media > img { transform: scale(1.02); }
.pcard:target .pcard-media, .pcard:has(.brand-anchor:target) .pcard-media { outline: 1px solid var(--accent); outline-offset: 4px; }
.pcard-media.nophoto { display: flex; align-items: center; justify-content: center; }
.pcard-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; padding: 16px 2px 0; }
.pcard h3 { font-size: 1.04rem; font-weight: 500; letter-spacing: -.005em; margin: 0; }
.pcard-foot { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.pcard-pair, .sys-link { font-size: .86rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; }
.pcard-pair:hover, .sys-link:hover { border-color: var(--text); }
.pcard-pair::after, .sys-link::after { content: " \2192"; }
.pcard-foot .btn { padding: 9px 16px; font-size: .88rem; }

/* Status: a marker and a word, not a pill */
.pstat { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.pstat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; flex: none; }
.pstat.in { color: var(--ok); }
.pstat.in::before { background: currentColor; }
.pstat.pre { color: var(--accent); }
.pstat.pre::before { background: currentColor; opacity: .5; }

/* Section rows on /compare ("See all specs" on /hands uses the shared .disclose) */
.cmpx-sec { border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border); }
.cmpx-sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0;
}
.cmpx-sec > summary::-webkit-details-marker { display: none; }
.cmpx-sec > summary::after {                /* same +/× mark as the shared .disclose */
  content: ""; flex: none; width: 14px; height: 14px; color: var(--muted);
  background:
    linear-gradient(currentColor, currentColor) center / 14px 1.25px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.25px 14px no-repeat;
  transition: transform .3s, color .2s;
}
.cmpx-sec[open] > summary::after { transform: rotate(45deg); }
.cmpx-sec > summary:hover::after { color: var(--text); }

/* All-specs sheet: one hairline row per model; stacks under 760px */
.cmp-lede { color: var(--muted); }
.cmp-lede a { color: var(--text); }
.cmp { list-style: none; margin: 24px 0; padding: 0; border-top: 1px solid var(--border-strong); }
.cmp li { border-bottom: 1px solid var(--border); }
.cmp-row {
  display: grid; align-items: center; gap: 4px 16px;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  grid-template-areas: "thumb model model" "thumb dof stat" "thumb rc rc";
  padding: 12px 0; color: var(--text); text-decoration: none; transition: background .2s;
}
.cmp-row:hover { background: var(--surface); }
.cmp-thumb {
  grid-area: thumb; width: 76px; aspect-ratio: 4 / 3; display: flex;
  background: var(--tile-bg); border-radius: var(--radius); overflow: hidden;
}
.cmp-thumb > img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.cmp-model { grid-area: model; display: flex; align-items: center; gap: 10px; min-width: 0; }
.cmp-model strong { font-weight: 500; font-size: .92rem; line-height: 1.25; min-width: 0; }
.cmp-dof { grid-area: dof; font-family: var(--mono); font-size: .78rem; min-width: 0; }
.cmp-stat { grid-area: stat; justify-self: end; }
.cmp-rc { grid-area: rc; font-size: .8rem; color: var(--muted); }
.cmp .k { color: var(--muted); margin-right: 8px; }
.cmp-head { display: none; }
@media (min-width: 760px) {
  .cmp-row, .cmp-head {
    grid-template-columns: 76px minmax(0, 1fr) minmax(0, 180px) 150px 120px;
    grid-template-areas: "thumb model dof stat rc";
  }
  .cmp-head { display: grid; gap: 16px; padding: 0 0 10px; margin-top: 28px; color: var(--muted); }
  .cmp-head + .cmp { margin-top: 0; }
  .cmp .k { display: none; }
  .cmp-stat { justify-self: start; }
}

/* /compare: Apple-style columns */
.cmpx { --cols: 3; margin-bottom: 40px; }
.cmpx-pick, .cmpx-heads, .cmpx-grid {
  display: grid; gap: 0 32px; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}
.cmpx-pick {
  position: sticky; top: 58px; z-index: 3; padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.cmpx-pick label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cmpx-k { color: var(--muted); }
.cmpx-select { position: relative; display: block; }
.cmpx-select::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1px solid var(--text); border-bottom: 1px solid var(--text); transform: rotate(45deg); pointer-events: none;
}
.cmpx select {
  appearance: none; -webkit-appearance: none; width: 100%;
  font: 500 .92rem/1.3 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 34px 10px 12px; cursor: pointer; text-overflow: ellipsis;
}
.cmpx select:hover { border-color: var(--text); }
.cmpx-heads { padding: 32px 0 40px; }
.cmpx-head { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.cmpx-media {
  width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tile-bg); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.cmpx-media > img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; animation: cmpx-in .5s ease both; }
@keyframes cmpx-in { from { opacity: 0; } to { opacity: 1; } }
.cmpx-head h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.15; letter-spacing: 0; margin: 22px 0 0; }
.cmpx-cta { margin-top: 18px; }
.cmpx-sec + .cmpx-sec { border-top: 0; }
.cmpx-sec > summary h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.cmpx-grid { padding: 8px 0 36px; }
.cmpx-cell { display: flex; flex-direction: column; gap: 28px; text-align: center; min-width: 0; }
.fig-v {
  font-family: var(--display); font-weight: 400; font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.15;
  letter-spacing: 0; color: var(--text);
}
.fig.empty .fig-v { color: var(--border-strong); }
.fig-rc { font-size: clamp(1.1rem, 2vw, 1.45rem); }
.fig-k { margin-top: 8px; color: var(--muted); line-height: 1.6; }
.fig-k .vs { display: block; color: var(--accent); font-size: .6rem; }
.fig.empty .fig-k .vs { color: var(--muted); opacity: .7; }
@media (max-width: 759px) {
  .cmpx { --cols: 2; }
  .cmpx [data-col="2"] { display: none; }
  .cmpx-pick, .cmpx-heads, .cmpx-grid { gap: 0 16px; }
  .cmpx select { font-size: .82rem; padding: 9px 28px 9px 10px; }
  .cmpx-head h3 { font-size: 1.15rem; }
  .cmpx-cta, .cmpx-cta .btn { width: 100%; text-align: center; }
  .cmpx-cta .btn { padding: 9px 10px; font-size: .86rem; }
  .fig-v { font-size: 1.2rem; }
}

/* /systems: three steps, a verdict, proven builds */
.fit {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  padding: 4px 10px; border: 1px solid currentColor; border-radius: var(--radius);
}
.fit::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.fit-a { color: var(--ok); }
.fit-b { color: var(--text); }
.fit-b::before { background: transparent; border: 1px solid currentColor; }
.fit-c { color: var(--muted); }
.fit-c::before { background: transparent; border: 1px dashed currentColor; }

.sys { padding: 56px 0 8px; scroll-margin-top: 70px; }
.sys-steps { display: grid; gap: 40px 32px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .sys-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sys-step label { display: flex; flex-direction: column; gap: 10px; font-weight: 500; font-size: 1.05rem; }
.sys-n { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: var(--accent); font-weight: 400; }
.sys select { appearance: none; -webkit-appearance: none; width: 100%;
  font: 500 .92rem/1.3 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 34px 10px 12px; cursor: pointer; text-overflow: ellipsis; }
.sys select:hover { border-color: var(--text); }
.sys-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 18px; }
.sys-media { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tile-bg); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; }
.sys-media > img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; animation: cmpx-in .5s ease both; }
.sys-empty { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: #6b6c68; }
.sys-card h3 { font-size: 1.04rem; font-weight: 500; margin: 4px 0 0; }
.sys-card .plate.xs { width: 84px; height: 30px; }
.sys-meta { margin: 0; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
@media (max-width: 859px) {
  /* stacked steps: photo left, text right, so the verdict stays close */
  .sys-steps { gap: 28px; }
  .sys-card { display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: 16px; row-gap: 6px; align-items: start; margin-top: 12px; }
  .sys-card > .sys-media { grid-row: 1 / span 5; }
  .sys-card > :not(.sys-media) { grid-column: 2; justify-self: start; }
  .sys-card h3 { margin: 0; font-size: .95rem; }
  .sys-result { margin-top: 32px; }
}
.sys-meta .vs { color: var(--accent); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }

.sys-result {
  display: grid; gap: 28px 40px; grid-template-columns: 1fr; align-items: center;
  margin-top: 48px; padding: 32px 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border);
}
@media (min-width: 860px) { .sys-result { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.sys-combo { display: flex; align-items: center; gap: 10px; }
.sys-thumb { flex: 1; aspect-ratio: 4 / 3; min-width: 0; overflow: hidden; background: var(--tile-bg); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.sys-thumb img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.sys-thumb.nophoto span { font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; color: #4a4b48; text-align: center; padding: 4px; }
.build-plus { font-family: var(--mono); color: var(--muted); flex: none; }
.sys-verdict h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: 0; margin: 16px 0 10px; }
.sys-verdict p { color: var(--muted); margin: 0 0 6px; max-width: 58ch; }
.sys-verdict .sys-note { font-size: .88rem; border-left: 1px solid var(--border-strong); padding-left: 12px; margin: 10px 0; }
.sys-verdict .btn { margin-top: 18px; }

.build-a { display: grid; gap: 24px 40px; grid-template-columns: 1fr; align-items: center; margin: 28px 0 40px; }
@media (min-width: 860px) { .build-a { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
.build-pics { display: flex; align-items: center; gap: 10px; }
.build-pic { flex: 1; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tile-bg); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.build-pic img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.build-pic.nophoto .plate.lg { width: 80%; height: 40%; }
.build-a h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.12; letter-spacing: 0; margin: 16px 0 10px; }
.build-a p { color: var(--muted); }
.builds-b { display: grid; gap: 32px 24px; grid-template-columns: 1fr; padding-top: 32px; border-top: 1px solid var(--border); }
@media (min-width: 560px) { .builds-b { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .builds-b { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.build-b { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: var(--text); text-decoration: none; }
.build-b .build-pics { width: 100%; gap: 6px; }
.build-b:hover .build-pic img { transform: scale(1.02); }
.build-b strong { font-weight: 500; font-size: .95rem; line-height: 1.3; }
.fit-key { margin: 0; display: grid; gap: 14px; }
.fit-key div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.fit-key dd { margin: 0; }
@media (max-width: 559px) { .fit-key div { grid-template-columns: 1fr; gap: 6px; } }

/* Phones: two-up cards */
@media (max-width: 559px) {
  .pgrid { gap: 32px 12px; }
  .pcard-body { padding-top: 12px; gap: 8px; }
  .pcard h3 { font-size: .9rem; }
  .pcard-foot { width: 100%; }
  .pcard-foot .btn { width: 100%; text-align: center; padding: 8px 10px; font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard-media > img, .cmpx-media > img, .plate img, .logo-wall a { transition: none; animation: none; }
  .pcard:hover .pcard-media > img { transform: none; }
}
