/* Page layout. Composes components; introduces no colour of its own. */

.lead {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.55;
  max-width: 620px;
  color: var(--body);
}

h1 {
  font-size: var(--text-hero);
}

.explainer {
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
}

.cost-hint {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
  color: var(--fog);
}

/* ------------------------------------------------------------- timeline */

.timeline:empty {
  display: none;
}
.timeline__track {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  padding: 0 0 var(--space-2);
  margin: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.timeline__frame {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  scroll-snap-align: start;
  border: 1px solid var(--rule);
  background: var(--rule-soft);
  transition: border-color var(--dur-fast) var(--ease);
}
.timeline__frame img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
/* Green means a result came from this frame — the same rule as everywhere. */
.timeline__frame.is-hit {
  border-color: var(--signal-deep);
  border-width: 2px;
}
.timeline__frame.is-linked {
  border-color: var(--ink);
  border-width: 2px;
}
.timeline__time {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 1px 3px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fog);
}
.timeline__coverage {
  display: flex;
  height: 26px;
  border: 1px solid var(--rule);
  margin-top: var(--space-2);
}
.timeline__covered {
  width: var(--width, 0%);
  background: var(--signal-wash);
  border-right: 2px solid var(--signal);
  flex: 0 0 auto;
}
.timeline__uncovered {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--fog);
  font-family: var(--font-mono);
  background-image: repeating-linear-gradient(
    45deg,
    var(--rule-soft),
    var(--rule-soft) 5px,
    var(--rule) 5px,
    var(--rule) 10px
  );
}
.timeline__ruler {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fog);
}

/* ------------------------------------------------- preview and paywall */

.counter {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}
.preview__headline {
  align-items: baseline;
}
.preview__label {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}

/* A locked row carries a real timestamp and a real platform, and hatching
 * where the source would be. Hatching rather than blur: blur implies an image
 * underneath that could be recovered, and there is none — the server never
 * sent one. */
.locked-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.locked {
  display: grid;
  grid-template-columns: minmax(70px, 96px) 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule-soft);
}
.locked__thumb {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule);
  background: repeating-linear-gradient(
    45deg,
    var(--rule-soft),
    var(--rule-soft) 5px,
    var(--dash) 5px,
    var(--dash) 10px
  );
}
.locked__line {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.offer__title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.offer__actions {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
}
.offer__primary {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
  text-align: left;
  padding: var(--space-5);
}
.offer__price {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.offer__cta {
  font-size: var(--text-sm);
  font-weight: 600;
}
.offer__note {
  color: var(--fog);
}

/* -------------------------------------------------------------- results */

.result-filters {
  margin-bottom: var(--space-2);
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 260px) 1fr;
  gap: var(--space-5);
  align-items: center;
}
.result-hero__media img,
.result-hero__media .thumb--missing {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--rule);
}

@media (max-width: 700px) {
  .result-hero {
    grid-template-columns: 1fr;
  }
}

.bucket {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: var(--space-4);
}
.bucket__summary {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  cursor: pointer;
  font-weight: 700;
}
.bucket__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fog);
  font-weight: 400;
}
.bucket__hint {
  margin: var(--space-1) 0 var(--space-3);
  font-size: var(--text-sm);
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.result {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--rule-soft);
}
.result__thumb {
  width: 88px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--rule-soft);
}
.thumb--missing {
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 10;
}
.result__body {
  min-width: 0;
}
/* URLs and titles are data, so they are mono. */
.result__title {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.result__title:hover {
  color: var(--signal-deep);
}
.result__meta {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.result__actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.result:hover .result__actions,
.result:focus-within .result__actions {
  opacity: 1;
}

@media (max-width: 560px) {
  .result {
    grid-template-columns: 64px 1fr;
  }
  .result__thumb {
    width: 64px;
  }
  .result__actions {
    grid-column: 1 / -1;
    opacity: 1;
  }
}

.upgrade:empty {
  display: none;
}

/* --------------------------------------------------------------- wallet */

.balance {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-4);
}
.balance__value {
  font-family: var(--font-mono);
  font-size: clamp(44px, 9vw, 78px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--signal-deep);
  font-variant-numeric: tabular-nums;
}

.amounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
}

/* A top-up amount. Square, bordered, paper — the same object the landing uses
 * for a price, so buying here looks like buying there. */
.amount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-3);
  background: var(--card);
  border: 1px solid var(--rule);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}

.amount:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink-wash);
}

.amount:disabled {
  opacity: 0.6;
  cursor: progress;
}

.amount__value {
  font-size: var(--text-lg);
  font-weight: 600;
}

.amount__note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fog);
}

.amounts__custom {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
  max-width: 22rem;
}

.api-key {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.api-key__value {
  flex: 1;
  min-width: 200px;
  padding: var(--space-2) var(--space-3);
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-x: auto;
  white-space: pre;
}

/* ---------------------------------------------------------------- chart */

.chart {
  width: 100%;
  height: auto;
}
.chart__bar {
  transition: opacity var(--dur-fast) var(--ease);
}
.chart__bar:hover {
  opacity: 0.7;
}
.chart-legend {
  display: flex;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fog);
}
.chart-legend__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: var(--space-1);
}

/* ---------------------------------------------------------------- admin */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

/* ---------------------------------------------------------------- login */

.auth-card {
  width: min(420px, 100%);
}

/* The DeepSearch offer. Paper rather than inverted: it is an upgrade, not the
 * paywall, and two black cards stacked read as one wall. */
.trace {
  border-color: var(--rule);
}

.trace__title {
  margin: 0;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}

/* The top-up offer. Two amounts, each carrying its own arithmetic, because the
 * split is the argument: you are not buying an unlock, you are adding balance
 * and spending part of it. */
.offer__amounts {
  display: grid;
  gap: var(--space-3);
}

.offer__amount {
  display: grid;
  gap: var(--space-1);
  text-align: left;
  padding: var(--space-4);
  height: auto;
}

.offer__split {
  opacity: 0.75;
}

.offer__short {
  margin: 0;
  color: var(--dash);
}
