/* Hardware comparison on the home page disclosure and performance page. Everything is scoped to .hw-*;
   it reuses the shared tokens and .table-wrap / table.t / .bar-* / .chip from style.css.
   Table rules are written as table.t.hw-table so they outrank the shared table.t rules. */

table.t.hw-table { min-width: 0; table-layout: fixed; }
table.t.hw-table th, table.t.hw-table td { padding: 16px 24px; }
table.t.hw-table thead th { vertical-align: bottom; padding-top: 20px; padding-bottom: 18px; }
table.t.hw-table col.c-machine { width: 28%; }
table.t.hw-table col.c-mem { width: 20%; }
table.t.hw-table col.c-ctx { width: 22%; }
table.t.hw-table col.c-code { width: 30%; }
/* one gradient across the whole highlighted row instead of one per cell */
table.t.hw-table tr.us { background: linear-gradient(90deg, rgba(108, 92, 255, .08), rgba(25, 201, 182, .06)); }
table.t.hw-table tr.us td { background: none; padding-top: 22px; padding-bottom: 22px; }
.hw-th-sub { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted-2); }

/* group headings inside the table */
table.t.hw-table tr.hw-group th {
  padding: 11px 24px; background: var(--bg-soft); border-bottom: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
  font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* machine */
.hw-machine { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hw-who { min-width: 0; }
.hw-mem-m { display: none; }
.hw-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-alt); color: var(--ink); display: grid; place-items: center; flex: none; }
.hw-icon svg { width: 20px; height: 20px; }
table.t.hw-table tr.us .hw-icon { background: var(--ink); color: #fff; }
.hw-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.hw-sub { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 400; color: var(--muted-2); line-height: 1.4; }
.hw-chip { height: 22px; padding: 0 9px; font-size: 11.5px; }
.hw-bad { background: #fff1e8; color: #c2410c; }
.hw-warn { background: #fef3c7; color: #b45309; }
.hw-nb { white-space: nowrap; }

/* rows that can't run the model at all are toned down */
table.t.hw-table tr.hw-nofit .hw-name, table.t.hw-table tr.hw-nofit .hw-big { color: var(--muted); }
table.t.hw-table tr.hw-nofit .hw-icon { opacity: .55; }

/* numbers */
.hw-big { font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hw-big.hw-none { color: var(--muted-2); }

/* concurrent context: 8 lanes, each filled to the per-chat limit (--fill = share of 262K) */
.hw-ctx { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-times { font-size: 13px; color: var(--muted); font-weight: 400; }
.hw-lanes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; max-width: 168px; margin-top: 10px; }
.hw-lanes i { position: relative; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.hw-lanes i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: #c9c9c4;
  transform: scaleX(0); transform-origin: left; transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
table.t.hw-table tr.us .hw-lanes i::after { background: linear-gradient(90deg, var(--accent), #a855f7 60%, var(--accent-2)); }
.hw-wrap.in .hw-lanes i::after { transform: scaleX(var(--fill, 1)); }
.hw-lanes i:nth-child(2)::after { transition-delay: .05s; }
.hw-lanes i:nth-child(3)::after { transition-delay: .1s; }
.hw-lanes i:nth-child(4)::after { transition-delay: .15s; }
.hw-lanes i:nth-child(5)::after { transition-delay: .2s; }
.hw-lanes i:nth-child(6)::after { transition-delay: .25s; }
.hw-lanes i:nth-child(7)::after { transition-delay: .3s; }
.hw-lanes i:nth-child(8)::after { transition-delay: .35s; }
.hw-td-ctx .hw-bad + .hw-sub { margin-top: 6px; }

/* coding speed */
.hw-speed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.hw-speed .bar-track { height: 10px; grid-column: auto; grid-row: auto; }
.hw-val { text-align: right; min-width: 96px; }
.hw-val b { display: block; font-family: var(--font-display); font-size: 23px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hw-val b.hw-none { color: var(--muted-2); font-weight: 400; }
.hw-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 5px; white-space: nowrap; }
.hw-range { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* legend + footnote */
.hw-foot { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.hw-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13.5px; color: var(--muted); }
.hw-legend .hw-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); margin: 0 6px; }
.hw-legend .chip:not(.chip-live) { background: #fff; border: 1px solid var(--line); }
.hw-foot .small { max-width: 900px; margin: 0; line-height: 1.75; }

@media (max-width: 1000px) {
  table.t.hw-table th, table.t.hw-table td { padding: 14px 16px; }
  table.t.hw-table tr.hw-group th { padding: 10px 16px; }
  .hw-icon { width: 34px; height: 34px; border-radius: 10px; }
  .hw-icon svg { width: 17px; height: 17px; }
  .hw-val { min-width: 84px; }
}

/* phones: each machine becomes its own card, memory moves into the card header */
@media (max-width: 820px) {
  .hw-wrap { border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  table.t.hw-table, table.t.hw-table tbody, table.t.hw-table tr { display: block; width: 100%; }
  table.t.hw-table colgroup, table.t.hw-table thead { display: none; }
  table.t.hw-table tr { background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 18px 4px; }
  table.t.hw-table tr + tr { margin-top: 12px; }
  table.t.hw-table tr.us { background: linear-gradient(135deg, rgba(108, 92, 255, .08), rgba(25, 201, 182, .06)), #fff; border-color: rgba(139, 125, 255, .35); }
  table.t.hw-table tr.hw-group { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 18px 4px 0; }
  table.t.hw-table tr.hw-group th { display: block; padding: 0; background: none; border: 0; }
  table.t.hw-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  table.t.hw-table tr.us td { padding: 12px 0; }
  table.t.hw-table td:first-child { display: block; padding: 0 0 14px; }
  table.t.hw-table td.hw-td-mem { display: none; }
  table.t.hw-table tr.hw-nofit td.hw-td-code { display: none; }
  table.t.hw-table tbody tr td:last-child, table.t.hw-table tbody tr.hw-nofit td.hw-td-ctx { border-bottom: 0; }
  table.t.hw-table tbody tr:last-child td:not(:last-child) { border-bottom: 1px solid var(--line-2); }
  table.t.hw-table tbody tr.hw-nofit:last-child td.hw-td-ctx { border-bottom: 0; }
  table.t.hw-table td[data-label]::before { content: attr(data-label); font-size: 12.5px; font-weight: 500; color: var(--muted); }
  .hw-mem-m { display: block; margin-left: auto; text-align: right; flex: none; }
  .hw-mem-m .hw-big { font-size: 18px; }
  .hw-provider .hw-mem-m { display: none; }
  .hw-lanes { max-width: none; }
  .hw-speed { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hw-val { order: -1; display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
  .hw-meta { margin-top: 0; }
}

@media (max-width: 720px) {
  table.t.hw-table tr.hw-mobile-hidden { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-lanes i::after { transform: scaleX(var(--fill, 1)); transition: none; }
}
