/*
 * The site is a plinth (design.md §5). Two thin near-black strips and, between
 * them, a canvas that belongs to somebody else. Nothing in this file may
 * develop a personality.
 */

:root {
  --chrome: #0a0a0b;
  --label: #8a8a8f;
  --paper: #ffffff;
  --signal: #ff4d2e;
  --edge: #26262a;
  --f-mast: "Libre Caslon Display", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --bar: 2.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--chrome);
  /* The top strip is sticky, so anything scrolled to — an archive row taking
     keyboard focus, an in-page anchor — must stop below it, not under it. */
  scroll-padding-top: var(--bar);
}
body {
  margin: 0;
  background: var(--chrome);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- chrome ---------- */
.chrome {
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.9rem;
  background: var(--chrome);
  color: var(--paper);
  gap: 1rem;
  white-space: nowrap;
}
.chrome.top {
  border-bottom: 1px solid var(--edge);
  position: sticky;
  top: 0;
  z-index: 30;
}
.chrome.bottom {
  border-top: 1px solid var(--edge);
}
.mast {
  font-family: var(--f-mast);
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
}
.meta {
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta b {
  color: var(--paper);
  font-weight: 500;
}
.cd {
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
.by {
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.by b {
  color: var(--paper);
  font-weight: 500;
}
.right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}
.bidamt {
  color: var(--signal);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

button {
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: var(--chrome);
  background: var(--paper);
  border: 1px solid var(--paper);
  border-radius: 0;
  padding: 0.42rem 0.7rem;
  /* Comfortable to hit without changing how it looks in the strip. */
  min-height: 2.15rem;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
button:hover:not(:disabled) {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--paper);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
button.ghost {
  background: transparent;
  color: var(--label);
  border-color: var(--edge);
}
button.ghost:hover:not(:disabled) {
  color: var(--paper);
  border-color: var(--paper);
  background: transparent;
}

/* ---------- the canvas ---------- */
.canvas {
  min-height: calc(100vh - (var(--bar) * 2));
  background: var(--paper);
  position: relative;
  overflow: hidden;
  display: block;
}
.canvas.swap {
  animation: swap 0.34s ease both;
}
@keyframes swap {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.canvas iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - (var(--bar) * 2));
  border: 0;
}
.canvas .loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: #a8aeb6;
  pointer-events: none;
}

/* ---------- archive ---------- */
.archive {
  padding: 2.5rem 1.25rem 4rem;
  max-width: 52rem;
  margin: 0 auto;
}
.archive h2 {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.9rem;
}
.archive ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--edge);
}
.archive li {
  border-bottom: 1px solid var(--edge);
}
.archive a.row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  width: 100%;
  min-height: 2.75rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--paper);
  padding: 0.78rem 0.25rem;
  font-size: 12.5px;
  text-decoration: none;
}
.archive a.row:hover {
  background: #141417;
  color: var(--paper);
}
.archive .d {
  flex: 0 0 2.1rem;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}
.archive .t {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive .a {
  flex: 0 0 auto;
  color: var(--label);
  font-size: 11.5px;
}
.archive li[aria-current] .t {
  color: var(--signal);
}
.archive .empty .t {
  color: var(--label);
  font-style: italic;
}
.note {
  color: var(--label);
  margin-top: 1.6rem;
  font-size: 11.5px;
  max-width: 34rem;
  line-height: 1.7;
}
.note a {
  color: var(--label);
}
.note code {
  color: var(--paper);
}

/* ---------- bid panel ---------- */
.panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--chrome);
  border-top: 1px solid var(--edge);
  padding: 1.1rem 1.25rem 1.4rem;
  transform: translateY(101%);
  transition: transform 0.28s cubic-bezier(0.3, 0.8, 0.3, 1);
  /* The panel is anchored to the bottom, so anything taller than the viewport
     grows off the TOP — taking the close button with it. On a phone that left
     no way to dismiss it at all. */
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel.open {
  transform: none;
}
.panel .inner {
  max-width: 52rem;
  margin: 0 auto;
}
.panel .hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.9rem;
}
.panel .hd span {
  color: var(--label);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.panel .figs {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.panel .fig .k {
  color: var(--label);
  font-size: 11px;
}
.panel .fig .v {
  font-size: 1.35rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: 0.1rem;
}
.panel .fig .v.sig {
  color: var(--signal);
}
.panel .acts {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.panel p {
  color: var(--label);
  font-size: 11.5px;
  margin: 1rem 0 0;
  line-height: 1.7;
}
.panel .err {
  color: var(--signal);
  font-size: 11.5px;
  margin-top: 0.8rem;
}
.panel input {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--edge);
  padding: 0.42rem 0.6rem;
  outline: none;
  min-width: 0;
}
.panel input:focus {
  border-color: var(--label);
}
.panel .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.panel .field label {
  color: var(--label);
  font-size: 11px;
}
.panel form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

@media (max-width: 640px) {
  :root {
    --bar: 2.5rem;
  }
  .mast {
    font-size: 1.1rem;
  }
  .chrome {
    font-size: 11.5px;
    padding: 0 0.7rem;
  }
  .archive .a {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none;
    transition: none;
  }
}
