/* Tile surface — 2026-11-12.
   The product reads as a grid of live tiles, not paragraphs: one tile per
   piece, tool or lane; the still is the tile face; a click opens the details
   in place. Every number comes from the one studio feed (studio.js); a tile
   with no data says so on its face instead of showing a dash. */

.tiles {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile, 240px), 1fr));
}
.tiles.tiles-stats { --tile: 200px; }
.tiles.tiles-lanes { --tile: 260px; }
.tiles.tiles-tools { --tile: 300px; }
.tiles.tiles-pieces { --tile: 220px; }
.tiles.tiles-plans { --tile: 250px; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel), #0d1524);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 220ms var(--ease), transform 220ms var(--ease), background 220ms var(--ease);
}
.tile:hover { border-color: #4a4433; transform: translateY(-2px); }
.tile:focus-visible { outline: 3px solid var(--cyan-hi); outline-offset: 2px; }
.tile.is-open { border-color: var(--gold); background: linear-gradient(180deg, #1a1608, #0d1524); }
.tile.static { cursor: default; }
.tile.static:hover { transform: none; border-color: var(--line); }

/* picture tiles: the still is the face */
.tile-media {
  padding: 0;
  overflow: hidden;
  background: var(--bg-2);
}
.tile-media .face {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0b0b09;
}
.tile-media .face img,
.tile-media .face video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 520ms var(--ease);
}
.tile-media:hover .face img { transform: scale(1.04); }
.tile-media .cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
}
.tile-media .cap b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.tile-media .cap .mono { font: 400 11px/1 var(--mono); color: var(--dimmer); letter-spacing: .06em; }
.tile-media .tile-more { padding: 0 13px 14px; }

/* text tiles: short lines only */
.tile .tile-kicker {
  font: 700 11px/1 var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.tile h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.tile .line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dim);
}
.tile .big {
  margin: 0;
  font: 800 32px/1 var(--font-display);
  letter-spacing: -.02em;
}
.tile .big small { font-size: 13px; font-weight: 600; color: var(--dim); margin-left: 5px; }
.tile .sub { margin: 0; font-size: 12.5px; color: var(--dimmer); }
.tile .emoji { font-size: 22px; line-height: 1; }
.tile .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* live / no-data badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font: 400 11px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--dim);
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dimmer);
}
.chip.live { color: var(--good); border-color: #33512e; }
.chip.live::before { background: var(--good); }
.chip.making { color: var(--accent); border-color: #57431f; }
.chip.making::before { background: var(--accent); animation: pulse 1.6s infinite; }
.chip.waiting { color: var(--warn); border-color: #57431f; }
.chip.waiting::before { background: var(--warn); }
.chip.stopped, .chip.nodata { color: var(--bad); border-color: #57302a; }
.chip.stopped::before, .chip.nodata::before { background: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .chip.making::before { animation: none; } }

/* the in-place expansion: hidden until the tile is opened */
.tile-more { display: none; }
.tile.is-open .tile-more {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
}
.tile-more dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.tile-more dt { color: var(--dimmer); }
.tile-more dd { margin: 0; color: var(--dim); font-variant-numeric: tabular-nums; }
.tile-more .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tile-more .acts a,
.tile-more .acts button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; min-height: 38px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font: 600 13px/1 var(--font-display); cursor: pointer;
}
.tile-more .acts a:hover, .tile-more .acts button:hover { border-color: var(--gold); color: var(--gold); }
.tile-more .acts .primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.tile-more .acts .primary:hover { background: var(--accent-hi); color: var(--accent-ink); }
.tile-more p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--dimmer); }

/* filter chips above the grids */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.filters button {
  padding: 9px 14px; min-height: 38px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--dim);
  font: 600 13px/1 var(--font-display); cursor: pointer; transition: all 180ms var(--ease);
}
.filters button:hover { color: var(--ink); border-color: #4a4433; }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.filters .count { font: 400 11px/1 var(--mono); opacity: .7; margin-left: 6px; }

/* freshness line under a live grid */
.feed-note {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 12px/1.5 var(--mono);
  color: var(--dimmer);
}
.feed-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.feed-note.stale .dot { background: var(--bad); }
.feed-note.stale { color: var(--bad); }

/* skeleton while the feed is in flight — never a dash, never a fake number */
.tile.loading .big,
.tile.loading .line { color: transparent; background: #1b2333; border-radius: 4px; }
.tile.loading .face { background: linear-gradient(100deg, #0b0b09 30%, #141c2c 50%, #0b0b09 70%); background-size: 200% 100%; animation: sweep 1.2s linear infinite; }
@keyframes sweep { to { background-position: -200% 0; } }

/* the mark's colour square (the word `.chip` now means a status badge) */
.mark .chip-dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--accent); display: inline-block; flex: 0 0 auto;
}

/* featured plan tile keeps the brand's accent treatment from site.css */
.tile.is-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, #2a1c08, #14100a);
}
.tile.is-featured:hover { border-color: var(--accent-hi); }

/* feed-driven badge states (facts.js sets `chip <state>`) */
.chip.ready, .chip.live { color: var(--good); border-color: #33512e; }
.chip.ready::before, .chip.live::before { background: var(--good); }
.chip.bound { color: var(--cyan-hi); border-color: #23485a; }
.chip.bound::before { background: var(--cyan-hi); }
.chip.blocked { color: var(--bad); border-color: #57302a; }
.chip.blocked::before { background: var(--bad); }
.chip.unbound, .chip.tmpl, .chip.probe { color: var(--warn); border-color: #57431f; }
.chip.unbound::before, .chip.tmpl::before, .chip.probe::before { background: var(--warn); }
.chip.nodata { color: var(--bad); border-color: #57302a; }
.chip.nodata::before { background: var(--bad); }

.nodata-text { color: var(--bad); font-size: 15px; font-weight: 600; }

/* figures used as tiles carry no default margins */
figure.tile { margin: 0; }
.tile figcaption { display: block; }

/* a tile that is a <details>: the summary is the face, the rest opens below */
details.tile { display: block; padding: 0; }
details.tile > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 16px;
}
details.tile > summary::-webkit-details-marker { display: none; }
details.tile .cap { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
details.tile .cap b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
details.tile .mono { font: 400 11px/1 var(--mono); color: var(--dimmer); letter-spacing: .05em; white-space: nowrap; }
details.tile[open] { border-color: var(--gold); }
details.tile .tile-more { display: none; padding: 0 16px 16px; }
details.tile[open] .tile-more { display: block; padding-top: 0; border-top: 0; }
details.tile .chip { justify-self: start; }
