/* The Painting — one image, one sentence, one list.
   Every company on the list gets a painting; votes decide who's next.
   Design language: vast white space, one centered object,
   bottom-anchored two-tone sentence. */

:root {
  --ink: #141412;
  --grey: #C9C7C2;
  --mid: #8A8880;
  --hairline: #ECEBE7;
  --pad: clamp(1.5rem, 4vw, 3.5rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Instrument Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: #FFFFFF;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

a { color: inherit; }

/* ---- Viewport one: the painting ---- */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
}

.corners {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--mid);
}
.corners a {
  text-decoration: none;
  color: var(--mid);
}
.corners a:hover { color: var(--ink); }

.middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 0;
}
.middle img {
  display: block;
  max-height: 52svh;
  max-width: min(560px, 88vw);
  width: auto;
  height: auto;
  animation: settle 1.2s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.middle figcaption {
  margin-top: 1.1rem;
  font-size: 0.78rem;
  color: var(--mid);
  text-align: center;
}
.middle figcaption em { font-style: italic; }

@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .middle img { animation: none; }
}

.sentence {
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
  max-width: 34ch;
}
.sentence .fade { color: var(--grey); }
.sentence a {
  color: inherit;
  text-decoration: none;
}
.sentence a:hover { color: var(--ink); }

/* ---- Viewport two: the leaderboard ---- */
.board {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--pad) * 2) var(--pad);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.board ol { list-style: none; }
.board li {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto auto;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  letter-spacing: -0.01em;
  background: #FFFFFF;
}
.board li:first-child { border-top: 1px solid var(--hairline); }
.board li.empty {
  display: block;
  color: var(--mid);
  font-size: 0.95rem;
}
.board .rank { font-size: 0.78rem; color: var(--grey); font-variant-numeric: tabular-nums; }
.board .votes { font-size: 0.85rem; color: var(--mid); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board li.leader .votes { color: var(--ink); }

.next-tag {
  display: inline-block;
  margin-left: 0.7rem;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  vertical-align: 0.12em;
  white-space: nowrap;
}

.row-vote {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--grey);
  padding: 0;
}
.row-vote:hover { color: var(--ink); }
.row-vote:disabled { color: var(--ink); cursor: default; }

.board-foot {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.line-input {
  flex: 1;
  min-width: 180px;
  border: none;
  border-bottom: 1px solid var(--hairline);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 0.6rem 0;
  background: none;
  border-radius: 0;
}
.line-input::placeholder { color: var(--grey); }
.line-input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.vote-btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: var(--ink);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
}
.vote-btn:hover { background: #000000; }

.board-msg {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--mid);
  min-height: 1.2em;
}

/* ---- Delivered: grows one row per painting shipped ---- */
.delivered {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--pad) calc(var(--pad) * 2);
}
.delivered h2 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--mid);
  margin-bottom: 0.75rem;
}
.delivered ol { list-style: none; }
.delivered li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  letter-spacing: -0.01em;
}
.delivered li:first-child { border-top: 1px solid var(--hairline); }
.delivered .piece em { font-style: italic; }
.delivered .to { color: var(--mid); font-size: 0.9em; }
.delivered .when { color: var(--grey); font-size: 0.78rem; white-space: nowrap; }
