/* Home page: the spool shelf and the filament race (js/main.js). Replaced the orb network in Nov 2026.
   A shelf of spools, one per filament type, each wound in its type's colour with today's cheapest $/kg under it.
   Tap one and every store's best price for it is extruded from a nozzle as a glowing strand: the strand's
   length is the price per kg, so the shortest one is the cheapest. It is a bar chart, drawn in filament. */

.app { position: relative; }
.home {
  max-width: 1120px; margin: 0 auto; padding: 0 0 36px;
  background:
    radial-gradient(60% 260px at 25% 0%, rgba(138, 107, 255, .16), transparent 70%),
    radial-gradient(50% 240px at 85% 10%, rgba(54, 227, 255, .10), transparent 70%);
}

/* ── hero */
.hero { padding: 34px 22px 6px; }
.hero-title {
  margin: 0 0 8px; font-size: clamp(26px, 4.2vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -0.025em;
  background: linear-gradient(90deg, #fff, #dfe3ff 40%, var(--accent-2) 75%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 0; max-width: 680px; font-size: 15.5px; line-height: 1.5; color: #c5cae8; }
#asOf { display: inline-block; color: var(--muted); font-size: 13px; }

/* ── the shelf */
.shelf-wrap { position: relative; padding: 0 22px; }
.shelf-scroll { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.shelf-scroll::-webkit-scrollbar { display: none; }
.shelf {
  list-style: none; margin: 0; padding: 26px 6px 0;
  display: flex; gap: 6px; justify-content: space-between; min-width: max-content;
}
.shelf li { flex: none; scroll-snap-align: start; }
.spool {
  display: flex; flex-direction: column; align-items: center; width: 72px; padding: 0 0 8px;
  text-decoration: none; color: var(--text); border-radius: 14px;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.spool .disc {
  --size: 62px;
  position: relative; display: block; width: var(--size); height: var(--size); border-radius: 50%;
  background:
    radial-gradient(circle, #04050d 0 14%, #3a3f63 14.5% 19%, transparent 19.5%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, .11) 0 1px, rgba(0, 0, 0, .12) 1px 3px),
    radial-gradient(circle, var(--c) 0 63%, #1d2140 63.5% 100%);
  box-shadow: inset 0 0 0 4px #1d2140, 0 8px 16px rgba(0, 0, 0, .55);
  transition: box-shadow .3s;
}
/* Flange shine, so it reads as a solid spool rather than a flat dot. */
.spool .disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, rgba(255, 255, 255, .24), transparent 45%); }
.spool .nm { margin-top: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.spool .pz { min-height: 1.3em; font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.spool:hover { transform: translateY(-5px); }
.spool:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.spool.is-on { transform: translateY(-12px); }
.spool.is-on .disc {
  box-shadow: inset 0 0 0 4px #1d2140, 0 0 0 2px var(--c), 0 0 28px 4px color-mix(in srgb, var(--c) 70%, transparent);
  animation: spool-spin 7s linear infinite;
}
.spool.is-on .pz { color: var(--text); }
@keyframes spool-spin { to { transform: rotate(1turn); } }
.plank {
  height: 12px; margin: 0 16px; border-radius: 3px;
  background: linear-gradient(#2a2f55, #14172e);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* ── the race */
.race-box { margin: 22px 22px 0; padding: 18px 20px 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); }
.race-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.race-head h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.015em; }
.race-sub { margin: 0; font-size: 13px; color: var(--muted); }
.race-sub b { color: var(--text); font-weight: 600; }
.race { list-style: none; margin: 18px 0 6px; padding: 0; display: grid; gap: 10px; }
.lane { display: grid; grid-template-columns: minmax(150px, 210px) 1fr 200px; align-items: center; gap: 6px 16px; }
.lane .who { min-width: 0; line-height: 1.25; }
.lane .who b { display: block; font-size: 14.5px; }
.lane .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { display: flex; align-items: center; min-width: 0; height: 28px; }
.nozzle { flex: none; width: 15px; height: 22px; background: linear-gradient(#d3d7f5, #6d7299); clip-path: polygon(0 0, 100% 0, 100% 55%, 65% 100%, 35% 100%, 0 55%); }
.strand {
  flex: none; height: 7px; width: 0; max-width: calc(100% - 140px); border-radius: 0 4px 4px 0;
  background: var(--c); box-shadow: 0 0 10px var(--c);
  transition: width 1s cubic-bezier(.2, .8, .2, 1);
}
.price { margin-left: 10px; font-family: var(--mono); font-weight: 700; font-size: 15px; white-space: nowrap; }
.price small { font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.price .off { color: var(--good); }
.price .cond { color: var(--warn); }
.lane.win .who b::after { content: ' 🏆'; }
.lane.win .strand { height: 10px; box-shadow: 0 0 16px 2px var(--c); }
.lane.win .price { font-size: 17px; }
.lane.dim { opacity: .62; }
.buy {
  /* Fixed column (see .lane), so every track is the same width and equal prices draw equal strands. */
  justify-self: end; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  padding: 7px 13px; border-radius: 999px; white-space: nowrap; text-decoration: none;
  font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, rgba(138, 107, 255, .7), rgba(54, 227, 255, .45));
  box-shadow: 0 0 12px rgba(138, 107, 255, .3);
}
.buy:hover { filter: brightness(1.15); }
.race-empty { color: var(--muted); font-size: 14px; }
.race-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.race-all { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); font-size: 13.5px; font-weight: 600; }
.race-all:hover { border-color: var(--accent-2); }
.race-link { color: var(--accent-2); font-size: 13.5px; text-decoration: none; }
.race-link:hover { color: #fff; text-decoration: underline; }

/* ── footer (same look as css/page.css .site-foot) */
.site-foot { border-top: 1px solid var(--line); padding: 22px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); }
.foot-social a { margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  .spool.is-on .disc { animation: none; }
  .strand { transition: none; }
}

/* ── phones */
@media (max-width: 760px) {
  .hero { padding: 22px 16px 2px; }
  .hero-sub { font-size: 14px; }
  .shelf-wrap { padding: 0 8px; }
  .shelf { gap: 6px; padding-top: 22px; justify-content: flex-start; }
  .spool { width: 66px; }
  .spool .disc { --size: 56px; }
  .spool .nm { font-size: 12px; }
  .spool .pz { font-size: 10.5px; }
  .plank { margin: 0 8px; height: 10px; }
  .race-box { margin: 18px 10px 0; padding: 14px 14px 12px; border-radius: 16px; }
  .race-head h2 { font-size: 18px; }
  .lane { grid-template-columns: 1fr 76px; gap: 2px 10px; }
  .buy-at { display: none; }
  .lane .who { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; }
  .lane .who b { display: inline; font-size: 14px; white-space: nowrap; }
  .lane .who span { display: inline; }
  .strand { max-width: calc(100% - 100px); }
  .price { font-size: 14px; }
  .lane.win .price { font-size: 15px; }
  .buy { padding: 7px 11px; font-size: 12.5px; }
  .race-foot { gap: 10px 14px; }
}

/* ── finish chips under the race heading (PLA: Basic, Silk, Multicolor, Glow, …; js/main.js FINISHES) */
.finishes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.finishes[hidden] { display: none; }
.finishes button {
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #c9cdf0; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.finishes button:hover { color: #fff; border-color: var(--line-2); }
.finishes button.on { color: var(--bg); background: var(--text); border-color: var(--text); }
@media (max-width: 760px) {
  .finishes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -14px; padding-right: 14px; }
  .finishes::-webkit-scrollbar { display: none; }
  .finishes button { flex: none; }
}
