/* Software carousel. Sizes measured on deepmind.google/research:
   396 px wide cards, 16:9 image with 24 px radius, 48 px gap, arrows in a pill below. */
:root {
  --sw-ink: #1d1d1f;
  --sw-muted: #5d5d66;
  --sw-accent: #369aae;
  --sw-pill: #f1f3f5;
  --sw-hover: linear-gradient(180deg, #f6f7f9 0%, #e9ecef 100%);
  --sw-hover-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

html[data-theme="dark"] {
  --sw-ink: #e6e6e6;
  --sw-muted: #a3a8b3;
  --sw-accent: #6fc3df;
  --sw-pill: #1b1e23;
  --sw-hover: radial-gradient(120% 75% at 50% 0%, #4a4e57 0%, #2c3037 55%, #23262c 100%);
  --sw-hover-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

#software {
  font-family: "Google Sans Text", "Google Sans", Roboto, Arial, sans-serif;
}

html body #software .sw-head h1 {
  font-family: "Google Sans", "Google Sans Text", Roboto, Arial, sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--sw-ink);
  margin: 0 0 32px;
}

.sw-track {
  display: flex;
  gap: 48px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 30px;
  margin: -30px;
  scroll-padding-left: 30px;
  scrollbar-width: none;
}

.sw-track::-webkit-scrollbar { display: none; }

.sw-card {
  flex: 0 0 min(396px, 86%);
  scroll-snap-align: start;
  font-size: 17px;
  line-height: 1.5;
  color: var(--sw-ink);
}

.sw-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sw-media.multigeom { background: #000 url("../../images/multigeom_card.jpeg") center 55% / cover no-repeat; }
.sw-media.spikecurate { background: #000 url("../../images/spikecurate_card.webp") center / cover no-repeat; }
.sw-media > * { position: relative; }
.sw-media img { max-height: 100%; max-width: 100%; width: auto; border: 0; }
.sw-media svg { width: 100%; max-width: 280px; height: auto; }

.sw-card { position: relative; cursor: pointer; isolation: isolate; }

/* Hover panel behind the card: a soft grey in dark mode, as if lit from above */
.sw-card::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 36px;
  background: var(--sw-hover);
  box-shadow: var(--sw-hover-shadow);
  opacity: 0;
  transition: opacity .35s ease;
}

.sw-card:hover::before,
.sw-card:focus-within::before { opacity: 1; }

/* The whole card is one link: the title link stretches over it, the other links sit above */
html body .sw-card h2 a.sw-main {
  border: 0;
  color: inherit;
}

.sw-main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sw-links { position: relative; z-index: 2; }

html body .sw-card:hover h2 a.sw-main { color: var(--sw-accent); }

.sw-main:focus-visible { outline: none; }
.sw-main:focus-visible::after { outline: 2px solid var(--sw-accent); outline-offset: 4px; border-radius: 24px; }

.sw-card h2 {
  margin: 20px 0 4px;
  font-family: "Google Sans", "Google Sans Text", Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--sw-ink);
}

.sw-card p { margin: 0 0 16px; color: var(--sw-muted); }

.sw-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

html body .sw-card a.sw-link {
  border: 0;
  font-size: 15px;
  color: var(--sw-muted);
}

html body .sw-card a.sw-link:hover { color: var(--sw-accent) !important; text-decoration: underline; }
html body .sw-card a.sw-link.primary { color: var(--sw-ink); font-weight: 600; }

.sw-arrows {
  display: inline-flex;
  margin-top: 24px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--sw-pill);
}

.sw-arrow {
  width: 44px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--sw-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sw-arrow:disabled { opacity: .35; cursor: default; }
.sw-arrow:focus-visible,
.sw-card a:focus-visible { outline: 2px solid var(--sw-accent); outline-offset: 2px; }

@media (max-width: 480px) {
  .sw-track { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .sw-track { scroll-behavior: auto; }
  .sw-card::before { transition: none; }
}
