/* EE Studio: the deck of live products. Builds on /styles.css; page classes are st-. */
:root {
  /* card stock: the same paper a few shades lighter, so cards read as objects on the page */
  --st-card: color-mix(in srgb, var(--paper) 52%, #fff);
  /* every shadow is the ink, never grey */
  --st-shade: 42 37 32;
  --st-ease-move: cubic-bezier(0.77, 0, 0.175, 1);
}

/* the nav on a page of its own: the current branch is filled, no gliding highlight */
.pill a[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .pill a:not([aria-current]):hover { color: var(--ink); }
}

/* ---------- head ---------- */
.st {
  width: var(--col);
  margin: 0 auto;
  padding: calc(64px + clamp(40px, 9vh, 104px)) 0 clamp(72px, 12vh, 128px);
}
.st-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
}
.st-title {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(52px, 7.2vw, 104px);
  line-height: 0.94;
  font-weight: 500;
  letter-spacing: -0.045em;
}
.st-lede {
  margin: 0 0 0.35em;
  max-width: 32ch;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--graphite);
}
.st-lede strong { color: var(--ink); font-weight: 500; }

/* ---------- filter: pills drawn on the paper; the chosen one is raised like a card ---------- */
.st-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: clamp(40px, 7vh, 72px) 0 clamp(20px, 3vh, 28px);
}
.st-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--graphite);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    transform 160ms var(--ease-out);
}
.st-chip__n { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.st-chip:active { transform: scale(0.96); }
.st-chip[aria-pressed="true"] {
  border-color: transparent;
  background: var(--st-card);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    0 0 0 1px rgb(var(--st-shade) / 0.05),
    0 1px 1px rgb(var(--st-shade) / 0.08),
    0 3px 6px -2px rgb(var(--st-shade) / 0.1),
    0 8px 14px -8px rgb(var(--st-shade) / 0.16);
}
@media (hover: hover) and (pointer: fine) {
  .st-chip:hover { color: var(--ink); }
  .st-chip:not([aria-pressed="true"]):hover { border-color: var(--graphite); }
}

/* ---------- the deck ---------- */
.st-deck {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr; /* one card height everywhere, so nothing resizes mid-shuffle */
  gap: clamp(14px, 1.6vw, 22px);
}
/* moves (FLIP); the card inside lifts. Sized by its column, never by what's in the card */
.st-slot { position: relative; display: flex; container-type: inline-size; }

.st-card {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: clamp(280px, 26vw, 344px);
  padding: 22px 22px 20px;
  border-radius: 20px;
  background-color: var(--st-card);
  /* a lit top edge and a hairline: the card stock itself */
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.75), 0 0 0 1px rgb(var(--st-shade) / 0.05);
  transition:
    transform 260ms var(--ease-out),
    background-color 320ms ease,
    box-shadow 320ms ease;
}
/* Three shadows make the depth: a tight contact shadow where the card touches the
   paper, a near one for its edge, a wide soft one for the room's light. Resting and
   lifted are two layers that crossfade, so nothing repaints a shadow per frame. */
.st-card::before,
.st-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  transition: opacity 260ms var(--ease-out);
}
.st-card::before {
  box-shadow:
    0 1px 2px rgb(var(--st-shade) / 0.1),
    0 6px 12px -4px rgb(var(--st-shade) / 0.1),
    0 22px 40px -16px rgb(var(--st-shade) / 0.24);
}
.st-card::after {
  opacity: 0;
  box-shadow:
    0 2px 4px rgb(var(--st-shade) / 0.06),
    0 16px 28px -10px rgb(var(--st-shade) / 0.14),
    0 48px 72px -22px rgb(var(--st-shade) / 0.3);
}
.st-card > * { transition: opacity 320ms ease; }

.st-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.st-icon {
  display: block;
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.st-card__go {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease-out), stroke 160ms ease;
}
.st-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--graphite);
  white-space: nowrap;
  transition: color 200ms ease, border-color 200ms ease;
}
.st-card__status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* a narrow card has no room for "In development" beside the icon: it goes underneath */
@container (max-width: 250px) {
  .st-card__top:has(.st-card__status) { flex-direction: column; align-items: flex-start; gap: 12px; }
}

.st-card__desc {
  margin: 26px 0 0;
  overflow-wrap: break-word;
  font-size: 18px;
  line-height: 1.33;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.st-card__foot { margin-top: auto; padding-top: 28px; }
.st-card__name {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
/* the whole card is the link; the name carries it so it's announced once, by name */
.st-card__name a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.st-card__name a:focus-visible { outline: none; }
.st-card:has(a:focus-visible) { outline: 1.5px solid var(--ink); outline-offset: 4px; }
.st-card__name .r { margin-right: 0; }

.st-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--graphite);
}
.st-card__tags li { transition: color 200ms ease; }
/* the tag you filtered by turns to ink on every card that has it */
.st-card .is-hit { color: var(--ink); }
.st-card__status.is-hit { border-color: var(--ink); }

/* lifted: picked up off the table for the shuffle */
.st-card.is-lifted {
  transform: translateY(-8px) scale(1.02);
  transition-duration: 180ms, 320ms, 320ms;
  transition-delay: var(--lift-delay, 0ms), 0ms, 0ms;
}
.st-card.is-lifted::before { opacity: 0.35; transition-duration: 180ms; }
.st-card.is-lifted::after { opacity: 1; transition-duration: 180ms; }

/* out: not what you asked for. It drops its body and stays as a line drawn on the paper */
.st-slot.is-out .st-card {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.st-slot.is-out .st-card::before,
.st-slot.is-out .st-card::after { opacity: 0; }
.st-slot.is-out .st-card > * { opacity: 0.4; }

@media (prefers-reduced-motion: no-preference) {
  .st-slot.is-out .st-card { transform: scale(0.97); }
}

@media (hover: hover) and (pointer: fine) {
  .st-slot:hover { z-index: 3; }
  .st-card:has(a):hover .st-card__go { stroke: var(--ink); transform: translate(2px, -2px); }
  .st-slot:not(.is-out) .st-card:has(a):hover::after { opacity: 0.55; }
  .st-slot.is-out .st-card:hover > * { opacity: 0.75; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .st-slot:not(.is-out) .st-card:has(a):not(.is-lifted):hover { transform: translateY(-3px); }
}

.st-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .st-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .st-head { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .st-title { font-size: clamp(48px, 13.5vw, 88px); }
  .st-lede { margin: 0; font-size: 18px; }
}

@media (max-width: 720px) {
  .st-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .st-card { min-height: 0; padding: 15px 14px 14px; border-radius: 16px; }
  .st-icon { width: 32px; height: 32px; }
  .st-card__go { width: 18px; height: 18px; }
  .st-card__status { padding: 2px 8px; font-size: 11.5px; }
  .st-card__desc { margin-top: 18px; font-size: 15px; line-height: 1.32; }
  .st-card__foot { padding-top: 20px; }
  .st-card__name { font-size: 17.5px; }
  .st-card__tags { gap: 0 9px; margin-top: 5px; font-size: 12.5px; line-height: 1.45; }
  .st-card.is-lifted { transform: translateY(-6px) scale(1.025); }

  /* the pills run off the edge and scroll sideways rather than stacking three rows deep */
  .st-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 32px calc(-1 * var(--gutter)) 12px;
    padding: 8px var(--gutter) 10px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  }
  .st-filter::-webkit-scrollbar { display: none; }
  .st-chip { flex: none; height: 38px; }
}
