/* Etude — the Models page: a version picker and one table. */

.models-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(28px, 5vh, 44px);
  font-size: 15px;
  color: var(--ink-2);
}
/* A button that opens its own list, rather than a native menu: the list
   drops under the pill and is styled like the rest of the site. */
.picker { position: relative; }
.picker-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 15px 8px 16px;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-lip);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.picker-button:hover,
.picker-button[aria-expanded="true"] { background: var(--glass-fill-hover); border-color: var(--glass-rim-hover); }
/* the chevron, which turns over while the list is open */
.picker-button::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.6px solid var(--ink-2);
  border-bottom: 1.6px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.2s ease, margin 0.2s ease;
}
.picker-button[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 4px; }
.picker-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 100%;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: var(--menu-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-lift-hover), var(--glass-lip);
  animation: picker-in 0.16s ease both;
}
.picker-list[hidden] { display: none; }
@keyframes picker-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.picker-list li {
  position: relative;
  padding: 8px 14px 8px 34px;
  border-radius: 9px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}
.picker-list li:hover,
.picker-list li:focus { background: var(--glass-fill-hover); }
.picker-list li:focus-visible { box-shadow: inset 0 0 0 2px rgb(var(--net)); }
/* a tick beside the entry being shown */
.picker-list li[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 5px;
  height: 10px;
  margin-top: -7px;
  border-right: 1.8px solid var(--ink);
  border-bottom: 1.8px solid var(--ink);
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .picker-list { animation: none; }
  .picker-button::after { transition: none; }
}

/* A real table — four models against six facts is a comparison of columns —
   set on a card, with rules between rows rather than a grid. */
.models-table {
  margin-top: 20px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  overflow-x: auto;
}
.models-table:empty { display: none; }
.models-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}
.models-table th,
.models-table td {
  padding: 16px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.models-table th:first-child { padding-left: 24px; }
.models-table th:last-child,
.models-table td:last-child { padding-right: 24px; }
.models-table tbody tr:last-child th,
.models-table tbody tr:last-child td { border-bottom: 0; }
.models-table thead th {
  padding-top: 14px;
  padding-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: bottom;
  color: var(--ink-3);
}
.models-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.models-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* the model's name leads its row */
.models-table td[data-label="Model"] { font-weight: 500; white-space: nowrap; }
.models-table td[data-label="Download"],
.models-table td[data-label="Draft ahead default"] { white-space: nowrap; }
.models-table a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--glass-rim-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.models-table a:hover { color: rgb(var(--net)); text-decoration-color: currentColor; }
.models-none { color: var(--ink-3); }
/* a repository name breaks after its owner, never inside a name */
.models-table .seg { white-space: nowrap; }

/* From 0.2.0, as in the app: each model is its place on a line from Speed
   to Smarts, shown as pips (one at the fast end), with its name on hover. */
.models-ends { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.models-end { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.models-end-icon { width: 12px; height: 12px; fill: currentColor; flex: none; }
.models-ends-line { width: 1.5px; height: 10px; margin-left: 5px; border-radius: 1px; background: currentColor; opacity: 0.5; }
.models-table th.models-place { cursor: default; }
/* one text line tall, so the pips sit level with the first line of the row */
.models-pips-box { display: flex; align-items: center; height: 1.45em; }
.models-pips { display: block; fill: var(--ink); }

.models-note {
  max-width: 68ch;
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* Seven columns need about a thousand pixels. Below that each model becomes
   its own block and the column headers move in front of the values as labels. */
@media (max-width: 1040px) {
  .models-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .models-table tr { display: block; padding: 18px 20px; border-bottom: 1px solid var(--line); }
  .models-table tbody tr:last-child { border-bottom: 0; }
  .models-table th,
  .models-table td { display: block; padding: 0; border: 0; white-space: normal; }
  .models-table th:first-child { padding-left: 0; }
  .models-table tbody th {
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .models-table td { padding: 2px 0; }
  .models-table td[data-label="Model"] { font-size: 19px; font-weight: 600; margin-bottom: 6px; white-space: normal; }
  .models-table td::before { content: attr(data-label) ": "; color: var(--ink-3); }
  .models-table td[data-label="Model"]::before { content: none; }
  /* the pips need their two ends: the first column's header stays as a legend */
  .models-table thead:has(.models-ends) { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .models-table thead:has(.models-ends) tr { padding: 14px 20px; }
  .models-table thead:has(.models-ends) th:not(:first-child) { display: none; }
  .models-ends { flex-direction: row; align-items: center; gap: 6px; }
  .models-ends-line { width: 22px; height: 1.5px; margin-left: 0; }
  .models-table th.models-place { margin-bottom: 10px; }
}

.models-picker[hidden] { display: none; }
