/* The homepage's drop band and the rack of finished cases beneath it. Linked
   last on index.html, so these rules sit after home.css in the cascade.
   Colours come from tokens.css — the band is the site's desk black on paper,
   the boxes on the pages are the site's accent. No image files: the page in
   the band and the four thumbnails are drawn in CSS. */

.drop-band-section {
  max-width: 870px;
  margin: 34px auto 0;
  padding: 0 24px;
}

/* ── the band ─────────────────────────────────────────────────────────── */

.drop-band {
  position: relative;
  min-height: 142px;
  display: grid;
  grid-template-columns: 152px 1fr auto;
  align-items: stretch;
  border: 1px solid var(--ink);
  background: var(--desk);
  color: var(--paper);
  outline: 5px solid transparent;
  transition: transform 180ms ease, outline-color 180ms ease;
}

.drop-band.is-dragging {
  transform: translateY(-3px);
  outline-color: rgba(var(--accent-rgb), 0.28);
}

.drop-band.is-sending {
  opacity: 0.72;
}

.drop-band-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid #333;
  background:
    linear-gradient(#262626 1px, transparent 1px),
    linear-gradient(90deg, #262626 1px, transparent 1px);
  background-size: 19px 19px;
}

.drop-band-page {
  position: relative;
  width: 58px;
  height: 78px;
  padding: 10px 8px;
  background: var(--paper-dark);
  box-shadow: 9px 7px 0 #73756e;
  transform: rotate(-4deg);
}

.drop-band-page i {
  width: 100%;
  height: 2px;
  margin-bottom: 5px;
  display: block;
  background: #b2b3ab;
}

.drop-band-page i:nth-child(2) { width: 75%; }
.drop-band-page i:nth-child(4) { width: 56%; }

/* the read field, the same mark the rest of the page puts around an extraction */
.drop-band-page::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 31px;
  width: 42px;
  height: 17px;
  border: 1.5px solid var(--accent);
  opacity: 0.9;
}

.drop-band-scan {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 50%;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15);
  animation: dropBandScan 2.8s ease-in-out infinite;
}

@keyframes dropBandScan {
  0%, 100% { transform: translateY(-35px); opacity: 0; }
  15%, 85% { opacity: 1; }
  50% { transform: translateY(35px); opacity: 1; }
}

.drop-band-copy {
  padding: 28px 30px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.drop-band-label {
  margin: 0 0 9px;
  font: 650 20px/1.2 var(--sans);
  letter-spacing: -0.025em;
  color: var(--paper);
}

.drop-band-note {
  max-width: 430px;
  margin: 0;
  color: #a9aaa3;
  font: 400 10px/1.55 var(--mono);
  letter-spacing: 0.04em;
}

.drop-band-control {
  min-width: 176px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}

.drop-band-choose,
.drop-band-run {
  min-width: 158px;
  min-height: 45px;
  padding: 0 14px;
  border: 1px solid var(--paper-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  background: var(--paper-dark);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.drop-band-run {
  color: var(--paper-dark);
  background: var(--accent);
  border-color: var(--accent);
}

.drop-band-choose svg,
.drop-band-run svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* The file input is inside its label, so the whole button opens the picker. */
.drop-band-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-band-chosen {
  max-width: 180px;
  margin: 0;
  color: #c8c9c2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font: 400 9px/1.4 var(--mono);
}

/* The picker is a label around a hidden input, so the ring that says where the
   keyboard is has to come from the label. */
.drop-band-choose:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drop-band-message {
  max-width: 870px;
  margin: 9px auto 0;
  color: var(--accent);
  font: 400 10px/1.4 var(--mono);
  letter-spacing: 0.04em;
}

/* ── the rack of finished cases ───────────────────────────────────────── */

.case-rack-section {
  max-width: 960px;
  margin: 35px auto 0;
  padding: 0 24px;
}

.case-rack-head {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.case-rack-kicker {
  margin: 0 0 5px;
  color: var(--graphite);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.case-rack-title {
  margin: 0;
  font: 700 21px/1.2 var(--sans);
  letter-spacing: -0.035em;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

/* Each card is a form of its own: the shelf position is in its address and the
   answer is a redirect into that sample's room. The button is the whole card. */
.case-card {
  min-width: 0;
  display: flex;
}

.case-card button {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  text-align: left;
  color: inherit;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: transform 170ms ease;
}

.case-card button::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border: 1.5px solid var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms ease;
}

.case-card button:hover,
.case-card button:focus-visible {
  z-index: 2;
  transform: translateY(-3px);
  outline: none;
}

.case-card button:hover::after,
.case-card button:focus-visible::after {
  opacity: 1;
}

.case-thumb {
  position: relative;
  height: 94px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--card-tone, var(--paper-dark));
}

.case-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(22, 22, 22, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(22, 22, 22, 0.07) 1px, transparent 1px);
  background-size: 14px 14px;
}

/* The page each card shows, with the read field where that case's answer sits. */
.case-doc {
  position: relative;
  width: 59px;
  height: 78px;
  padding: 8px 7px;
  display: block;
  background: #f7f7f2;
  border: 1px solid #babbb3;
  box-shadow: 7px 5px 0 rgba(22, 22, 22, 0.2);
  transform: rotate(-2deg);
}

.case-doc i {
  height: 2px;
  margin-bottom: 4px;
  display: block;
  background: #aeb0a7;
}

.case-doc i:nth-child(1) {
  width: 52%;
  height: 4px;
  background: #5e605b;
}

.case-doc i:nth-child(3),
.case-doc i:nth-child(6) { width: 72%; }

.case-doc::after {
  content: "";
  position: absolute;
  left: var(--box-x, 7px);
  top: var(--box-y, 34px);
  width: var(--box-w, 43px);
  height: var(--box-h, 15px);
  border: 1px solid var(--accent);
}

.case-arrow {
  position: absolute;
  z-index: 1;
  top: 20px;
  right: 20px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(22, 22, 22, 0.5);
  background: rgba(249, 249, 247, 0.84);
  color: var(--ink);
}

/* The glyph moves inside the box on hover, not the box with it. */
.case-arrow svg {
  width: 12px;
  height: 12px;
  transition: transform 170ms ease;
}

.case-card button:hover .case-arrow svg,
.case-card button:focus-visible .case-arrow svg {
  transform: translate(2px, -2px);
}

/* The body fills the card so the "open" line sits on one baseline across a
   row, whatever the description costs in lines. */
.case-card-body {
  flex: 1;
  padding: 14px 3px 7px;
  display: flex;
  flex-direction: column;
}

.case-industry {
  margin-bottom: 9px;
  display: block;
  color: var(--graphite);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.case-title {
  margin-bottom: 7px;
  display: block;
  font: 600 15px/1.12 var(--sans);
  letter-spacing: -0.025em;
}

.case-desc {
  display: block;
  color: var(--graphite);
  font-size: 10px;
  line-height: 1.45;
}

/* ── narrower ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .drop-band { grid-template-columns: 112px 1fr; }

  .drop-band-control {
    grid-column: 1 / -1;
    min-height: 78px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #333;
  }

  .drop-band-chosen { text-align: left; }

  .case-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .drop-band { grid-template-columns: 1fr; }

  .drop-band-visual {
    min-height: 94px;
    border-right: 0;
    border-bottom: 1px solid #333;
  }

  .drop-band-copy { padding: 24px; }

  .drop-band-control {
    flex-direction: column;
    align-items: stretch;
  }

  .drop-band-chosen { max-width: none; text-align: left; }

  .case-rack-head {
    align-items: flex-start;
    flex-direction: column;
  }


  .case-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .drop-band-scan { animation: none; }

  .drop-band,
  .case-card button,
  .case-card button::after,
  .case-arrow svg { transition: none; }
}
