* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--refresh-ink);
  color: var(--refresh-paper);
  font-family: var(--refresh-text);
}

.refresh-site {
  background: var(--refresh-ink);
  color: var(--refresh-paper);
  color-scheme: dark;
  font-family: var(--refresh-text);
  -webkit-font-smoothing: antialiased;
}

.refresh-site ::selection {
  background: var(--refresh-mint);
  color: var(--refresh-ink);
}

.refresh-site :focus-visible,
.refresh-skip:focus-visible {
  outline: 2px solid var(--refresh-gold);
  outline-offset: 5px;
}

.refresh-skip {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10000;
  padding: .8rem 1rem;
  transform: translateY(-200%);
  background: var(--refresh-mint);
  color: var(--refresh-ink);
  font-weight: 800;
}

.refresh-skip:focus { transform: none; }

.refresh-wrap {
  width: min(100% - clamp(2rem, 8vw, 9rem), 80rem);
  margin-inline: auto;
}

.refresh-site :is(section, main)[id],
#refresh-main { scroll-margin-top: 96px; }

.refresh-site :is(h1, h2, h3, p, figure) { margin: 0; }

.refresh-site :is(h1, h2, h3) {
  font-family: var(--refresh-display);
  font-weight: 700;
  letter-spacing: -.04em;
}

.refresh-site h2 {
  font-size: clamp(2.5rem, 5.2vw, 5rem);
  line-height: .99;
  text-wrap: balance;
}

.refresh-site h3 { font-size: 1.45rem; }

.refresh-site p {
  color: var(--refresh-muted);
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  line-height: 1.68;
}

.refresh-hero {
  display: grid;
  grid-template-columns: minmax(0, .97fr) minmax(0, 1.03fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  padding-block: clamp(2.4rem, 4vw, 4.1rem) clamp(3rem, 6.6vw, 6rem);
}

.refresh-intro h1 {
  color: var(--refresh-paper);
  font-size: clamp(3.35rem, 7.25vw, 6rem);
  line-height: .94;
  text-wrap: balance;
}

.refresh-intro h1 em {
  display: block;
  font-style: normal;
  color: var(--refresh-mint);
}

.refresh-intro > p {
  max-width: 34ch;
  margin-top: 1.6rem;
}

.refresh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  margin-top: 1.75rem;
}

.refresh-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 48px;
  font: 800 .94rem var(--refresh-text);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.refresh-actions button:disabled {
  opacity: .58;
  cursor: default;
}

.refresh-button {
  padding: .75rem 1rem;
  color: var(--refresh-ink);
  background: var(--refresh-mint);
  border: 1px solid var(--refresh-mint);
}

.refresh-button:hover:enabled { background: #cbf7d6; }

.refresh-button svg { transition: transform .5s var(--refresh-ease); }

.refresh-button:hover:enabled svg { transform: rotate(37deg); }

.refresh-save {
  padding: .75rem .9rem;
  background: transparent;
  border: 1px solid var(--refresh-line);
  color: var(--refresh-paper);
}

.refresh-save:hover:enabled {
  border-color: var(--refresh-muted);
  color: var(--refresh-mint);
}

.refresh-edition {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: 1.65rem;
  color: var(--refresh-muted);
  font-size: .79rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.refresh-edition::before {
  content: "";
  width: .55rem;
  height: .55rem;
  background: var(--refresh-gold);
  transform: rotate(45deg);
}

.refresh-site .refresh-art {
  justify-self: end;
  width: min(100%, 34rem);
  overflow: hidden;
  background: var(--refresh-surface);
  border-radius: 8px;
  box-shadow: 0 1.2rem 2.8rem #080c1469;
}

.refresh-art-surface {
  position: relative;
  aspect-ratio: 1;
  background: var(--refresh-mint) url("TheRefresh.webp") center / cover no-repeat;
}

.refresh-art-surface canvas {
  display: block;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

.refresh-art-surface canvas[data-ready] { visibility: visible; }

.refresh-art-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 1rem;
  padding: .9rem 1rem;
  color: var(--refresh-paper);
  font: 700 .82rem var(--refresh-display);
  font-variant-numeric: tabular-nums;
}

.refresh-art-meta > :last-child {
  color: var(--refresh-muted);
  font-size: .72rem;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.refresh-art:not(:has(canvas[data-ready])) .refresh-art-meta > :last-child {
  display: none;
}

.refresh-art noscript p {
  padding: 0 1rem .75rem;
  font-size: .8rem;
}

.refresh-palette {
  height: 4px;
  background: linear-gradient(to right,
    var(--refresh-mint) 0 58%,
    var(--refresh-cobalt) 58% 75%,
    var(--refresh-gold) 75% 81%,
    var(--refresh-rose) 81% 100%);
}

.refresh-story {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: clamp(2rem, 9vw, 8rem);
  align-items: center;
  padding-block: clamp(3.5rem, 8vw, 8rem);
}

.refresh-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.refresh-cover figcaption {
  padding-top: .8rem;
  color: var(--refresh-muted);
  font-size: .8rem;
  font-weight: 700;
}

.refresh-story-copy h2 { color: var(--refresh-mint); }

.refresh-story-copy p,
.refresh-community p {
  max-width: 44ch;
  margin-top: 1.25rem;
}

.refresh-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.5rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.refresh-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .45rem;
  color: var(--refresh-paper);
  text-underline-offset: .3em;
  text-decoration-color: var(--refresh-mint);
  font-weight: 800;
}

.refresh-links a:hover { color: var(--refresh-mint); }

.refresh-variations {
  background: var(--refresh-blue-ink);
  padding-block: clamp(3.5rem, 7vw, 7rem);
}

.refresh-section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(2rem, 4.5vw, 4rem);
}

.refresh-section-head h2 { color: var(--refresh-gold); }

.refresh-section-head p { max-width: 36ch; }

.rarity-explorer {
  --rarity-accent: var(--refresh-mint);
  background: var(--refresh-surface);
  border: 1px solid #526481;
  border-radius: 8px;
}

.rarity-explorer[data-group="gradients"] { --rarity-accent: #91b5ff; }
.rarity-explorer[data-group="themes"] { --rarity-accent: var(--refresh-gold); }

.rarity-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .9rem 1.5rem;
  padding: .85rem clamp(1rem, 2.5vw, 2rem);
  border-bottom: 1px solid var(--refresh-line);
}

.rarity-groups {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.rarity-groups button,
.rarity-entry {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--refresh-paper);
  font: 700 .85rem var(--refresh-text);
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.rarity-groups button { padding: .4rem .8rem; }

.rarity-groups button:hover,
.rarity-entry:hover {
  border-color: var(--refresh-line);
  background: var(--refresh-blue-ink);
}

.rarity-groups button[aria-pressed="true"] {
  background: var(--rarity-accent);
  color: var(--refresh-ink);
}

.rarity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
}

.rarity-instrument {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .25rem;
  min-width: 0;
  padding: clamp(.75rem, 2.4vw, 2rem);
  background: radial-gradient(circle at 50% 45%, #202f46, var(--refresh-ink) 72%);
  border-right: 1px solid var(--refresh-line);
  border-bottom-left-radius: 7px;
}

#rarity-map {
  display: block;
  width: min(100%, 31rem);
  height: auto;
}

.rarity-instrument figcaption {
  max-width: 43ch;
  color: var(--refresh-muted);
  font-size: .83rem;
  line-height: 1.6;
  text-align: center;
}

.rarity-guide {
  fill: none;
  stroke: #526481;
  stroke-width: .7;
}

.rarity-center { fill: var(--rarity-accent); }

.rarity-spoke {
  color: var(--rarity-accent);
  cursor: pointer;
  opacity: .68;
  transition: opacity .18s ease, color .18s ease;
}

.rarity-spoke:is(:hover, .is-selected) {
  color: var(--refresh-paper);
  opacity: 1;
}

.rarity-spoke.is-selected {
  color: var(--rarity-trait-color, var(--refresh-paper));
}

.rarity-spoke.is-filtered {
  opacity: .15;
  pointer-events: none;
}

.rarity-ray {
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.rarity-spoke.is-selected .rarity-ray { stroke-width: 3; }
.rarity-tip { fill: var(--rarity-trait-color, currentColor); }
.rarity-spoke:hover:not(.is-selected) .rarity-tip { fill: currentColor; }

.rarity-hit {
  fill: transparent;
  pointer-events: fill;
}

.rarity-spoke.is-filtered .rarity-hit { pointer-events: none; }

.rarity-inspector {
  min-width: 0;
  padding: clamp(1rem, 3vw, 2.6rem);
}

.rarity-selection {
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--refresh-line);
}

.rarity-selection h3 {
  font-size: clamp(1.65rem, 3.2vw, 2.85rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.refresh-site .rarity-selection-share {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .7rem;
  align-items: baseline;
  margin-top: .35rem;
  font-size: .85rem;
}

#rarity-entry-share {
  color: var(--rarity-selected-color, var(--rarity-accent));
  font: 700 clamp(1.85rem, 3.6vw, 3.1rem)/1 var(--refresh-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.refresh-site #rarity-group-description {
  margin-top: .75rem;
  font-size: .9rem;
}

.rarity-query-label {
  display: block;
  margin: 1.1rem 0 .4rem;
  font-size: .8rem;
  font-weight: 800;
}

#rarity-query {
  width: 100%;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 1px solid #526481;
  border-radius: 4px;
  background: var(--refresh-ink);
  color: var(--refresh-paper);
  font: 600 .95rem var(--refresh-text);
}

#rarity-query::placeholder { color: var(--refresh-muted); }

.refresh-site #rarity-count {
  margin-top: .55rem;
  font-size: .78rem;
}

#rarity-results {
  max-height: 11.25rem;
  overflow-y: auto;
  margin: .4rem 0 0;
  padding: .15rem .5rem .15rem .35rem;
  list-style: none;
  scrollbar-color: #667b96 var(--refresh-ink);
}

#rarity-results li + li { border-top: 1px solid var(--refresh-line); }

.rarity-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .55rem .6rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.rarity-entry[aria-pressed="true"] {
  border-color: var(--rarity-accent);
  color: var(--rarity-accent);
}

.rarity-entry:focus-visible { outline-offset: -3px; }

.rarity-empty {
  padding: .65rem .4rem;
  color: var(--refresh-muted);
  font-size: .85rem;
}

.rarity-archive {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1.4rem;
  margin-top: 1.1rem;
  color: var(--refresh-muted);
  font-size: .87rem;
}

.rarity-archive .refresh-links { margin: 0; }

.refresh-community {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-top: clamp(3.5rem, 7.5vw, 7.5rem);
}

.refresh-community img {
  flex: 0 0 auto;
  width: clamp(3.5rem, 9vw, 6rem);
  height: auto;
}

@media (max-width: 900px) {
  .refresh-hero { gap: 2rem; }
  .refresh-intro h1 { font-size: clamp(3rem, 7vw, 4.5rem); }
}

@media (max-width: 700px) {
  .refresh-hero, .refresh-story, .refresh-section-head, .rarity-layout {
    grid-template-columns: 1fr;
  }

  .refresh-intro h1 { font-size: clamp(3rem, 11.9vw, 5rem); }
  .refresh-intro > p { margin-top: 1.1rem; }
  .refresh-actions { margin-top: 1.25rem; }
  .refresh-edition { margin-top: 1rem; }
  .refresh-site .refresh-art { justify-self: start; }
  .refresh-story-copy { grid-row: 1; }
  .refresh-cover { max-width: 30rem; }
  .rarity-instrument {
    border-right: 0;
    border-bottom: 1px solid var(--refresh-line);
    border-bottom-left-radius: 0;
  }
  .refresh-community { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .refresh-site *, .refresh-site *::before, .refresh-site *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
