@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100,400;100,500;125,600;125,700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ValhallaMC downloads.
   Palette comes from the deepslate layer, not from a generic dark theme.
   The one loud element is the region glyph: a plot of a world's real r.X.Z
   coordinates. Everything else stays quiet so that reads first. */

:root {
  --void:      #141A26;
  --deepslate: #2B3242;
  --stone:     #6C7789;
  --chalk:     #E6E9EF;
  --copper:    #4F9E86;
  --amethyst:  #9B7EDE;

  --edge: 1px solid rgba(230, 233, 239, 0.10);
  --measure: 68ch;

  --step--1: 0.82rem;
  --step-0:  1rem;
  --step-1:  1.32rem;
  --step-2:  1.9rem;
  --step-3:  3.1rem;
  --step-4:  clamp(3.4rem, 9vw, 6.4rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--void);
  color: var(--chalk);
  font-family: 'Archivo', system-ui, sans-serif;
  font-variation-settings: 'wdth' 100;
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
  font-variation-settings: 'wdth' 125;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}

/* Numbers only. Mono here does real work: it keeps the size and count
   columns aligned down the page. */
.num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
}

.wrap {
  width: min(100% - 2.5rem, 76rem);
  margin-inline: auto;
}

/* ---------- header ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: var(--edge);
}

.masthead h1 {
  font-size: var(--step-1);
  margin-right: auto;
}

.masthead nav {
  display: flex;
  gap: 1.4rem;
}

.masthead nav a {
  color: var(--stone);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  color: var(--chalk);
  border-bottom-color: var(--copper);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  border-bottom: var(--edge);
}

.hero-title {
  font-size: var(--step-4);
  margin-bottom: 1.2rem;
}

.hero-blurb {
  color: var(--stone);
  max-width: var(--measure);
  margin: 0 0 2rem;
}

/* The glyph. Each dot is one region file, 512x512 blocks of a real world. */
.glyph {
  display: block;
  width: 100%;
  height: auto;
  background: rgba(0, 0, 0, 0.22);
  border: var(--edge);
}

.glyph rect { fill: var(--copper); }

.glyph-caption {
  color: var(--stone);
  font-size: var(--step--1);
  margin-top: 0.7rem;
}

/* ---------- fact table ---------- */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.6rem;
  margin: 0 0 2rem;
}

.facts dt {
  color: var(--stone);
  font-size: var(--step--1);
}

.facts dd {
  margin: 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
}

/* ---------- collections and rows ---------- */

.collection {
  padding: clamp(2rem, 5vw, 3.4rem) 0 1rem;
}

.collection-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.collection-head h2 { font-size: var(--step-2); }

.collection-count {
  color: var(--stone);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: var(--step--1);
}

.collection-blurb {
  color: var(--stone);
  max-width: var(--measure);
  margin: 0 0 1.6rem;
}

.rows { border-top: var(--edge); }

.row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) max-content;
  align-items: center;
  gap: 1.2rem;
  padding: 0.85rem 0.5rem;
  border-bottom: var(--edge);
}

/* One world, one row. Each format gets its own button with its own size, so
   nobody has to work out why the same title is listed twice. */
.row-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.get-size {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  opacity: 0.75;
  margin-left: 0.5rem;
}

.row:hover { background: rgba(79, 158, 134, 0.06); }

.row-glyph { width: 2.6rem; height: 2.6rem; opacity: 0.85; }

.row-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-name b { font-weight: 500; }

.row-file {
  display: block;
  color: var(--stone);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.74rem;
}

.row-size, .row-date {
  color: var(--stone);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
  text-align: right;
}

/* The long tail of uncatalogued uploads. Present, reachable, not in the way. */
.older { margin-top: 1.6rem; }

.older summary {
  cursor: pointer;
  color: var(--stone);
  padding: 0.6rem 0;
  border-top: var(--edge);
  list-style-position: inside;
}

.older summary:hover { color: var(--chalk); }

.older[open] summary { color: var(--chalk); }

/* No footprint for these, so the glyph column goes away. */
.row-plain { grid-template-columns: minmax(0, 1fr) max-content; }

.older code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.8em;
  color: var(--copper);
}

/* ---------- actions ---------- */

.get {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  color: var(--void);
  background: var(--amethyst);
  font-weight: 500;
  text-decoration: none;
}

.get:hover { background: #B199E8; }

.get-quiet {
  background: transparent;
  color: var(--amethyst);
  border: 1px solid rgba(155, 126, 222, 0.5);
}

.get-quiet:hover {
  background: rgba(155, 126, 222, 0.12);
  color: var(--amethyst);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ---------- stats ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.6rem;
  padding: 2rem 0;
  border-bottom: var(--edge);
}

.stat-value {
  font-variation-settings: 'wdth' 125;
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--stone);
  font-size: var(--step--1);
  margin-top: 0.3rem;
}

.bars { margin: 1.2rem 0 0; padding: 0; list-style: none; }

.bars li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) 4rem;
  align-items: center;
  gap: 1rem;
  padding: 0.3rem 0;
}

.bar {
  height: 0.6rem;
  background: var(--copper);
  min-width: 2px;
}

.bar-count {
  color: var(--stone);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
  text-align: right;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table.data th {
  text-align: left;
  font-weight: 500;
  color: var(--stone);
  font-size: var(--step--1);
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: var(--edge);
}

table.data td {
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: var(--edge);
}

table.data td.n {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: var(--step--1);
}

/* ---------- empty state ---------- */

.empty {
  padding: 3rem 0;
  color: var(--stone);
  max-width: var(--measure);
}

/* ---------- footer ---------- */

.foot {
  padding: 3rem 0 4rem;
  margin-top: 3rem;
  border-top: var(--edge);
  color: var(--stone);
  font-size: var(--step--1);
}

.foot a { color: var(--chalk); }

/* ---------- quality floor ---------- */

:focus-visible {
  outline: 2px solid var(--amethyst);
  outline-offset: 3px;
}

@media (max-width: 46rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-title { font-size: var(--step-3); }
  .row {
    grid-template-columns: 2.2rem minmax(0, 1fr);
    row-gap: 0.5rem;
  }
  /* Buttons drop under the name rather than squeezing it. */
  .row-formats {
    grid-column: 2;
    justify-content: flex-start;
  }
  .bars li { grid-template-columns: 6.5rem minmax(0, 1fr) 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
