@font-face {
  font-family: Barlow Condensed;
  src: url("assets/barlow-condensed-heavy.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: DM Sans;
  src: url("assets/dm-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #130f12;
  --oxblood: #28171d;
  --pine: #121f1a;
  --text: #fff4e1;
  --muted: #d9c2b8;
  --salmon: #ff9b92;
  --cranberry: #a83046;
  --evergreen: #a8cbbb;
  --edge: #775157;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --stripe: repeating-linear-gradient(125deg, #d95861 0 9px, #f5e1bf 9px 16px, #45725e 16px 25px, #f5e1bf 25px 32px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 0; background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--night);
  font: 1rem/1.5 var(--font);
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
::selection { background-color: var(--salmon); color: var(--night); }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.meme-wall, .snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.meme-wall {
  background:
    linear-gradient(124deg, rgba(46, 14, 27, .65), rgba(11, 25, 19, .53) 46%, rgba(25, 13, 19, .7)),
    url("assets/niomas-tile.webp") 50% 0 / clamp(9rem, 17vw, 13.5rem) auto repeat;
}

.snow {
  overflow: hidden;
  opacity: .52;
}

.snow::before, .snow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  animation: snow 32s linear infinite;
}

.snow::before {
  --snow-height: 247px;
  background-image:
    radial-gradient(circle at 20px 74px, #fff1d9 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 103px 236px, #fff1d9 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 137px 11px, #fff1d9 0 1px, transparent 1.7px);
  background-size: 231px var(--snow-height);
}

.snow::after {
  --snow-height: 311px;
  background-image:
    radial-gradient(circle at 52px 3px, #fff1d9 0 1px, transparent 2px),
    radial-gradient(circle at 294px 196px, #fff1d9 0 1.7px, transparent 2.4px);
  background-size: 333px var(--snow-height);
  animation-duration: 23s;
}

@keyframes snow {
  to { background-position: 0 var(--snow-height); }
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: calc(5.65rem + env(safe-area-inset-bottom));
}

.shell {
  width: min(92.5rem, calc(100% - 3rem));
  margin-inline: auto;
}

.topbar {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eac6ab62;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font: 800 1.75rem/1 var(--display);
}

.wordmark img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: cover;
  border: 1px solid #f6d7a9b0;
  border-radius: 2px;
}

.wordmark span { text-shadow: 0 2px 12px #0b0708; }
.wordmark:hover { color: var(--salmon); }

.header-ornament {
  width: .73rem;
  height: .73rem;
  margin-inline: .3rem;
  border: 1px solid var(--salmon);
  background: #f3b39e;
  transform: rotate(45deg);
  box-shadow: 0 2px 15px #f3b39e9c;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: clamp(2.5rem, 6.4vw, 6.6rem);
  padding-block: clamp(3rem, 5.75vw, 5rem);
}

.identity { container-type: inline-size; min-width: 0; }

h1 {
  margin: 0;
  font: 800 clamp(3.8rem, 8vw, 8.25rem)/.83 var(--display);
  font-size: clamp(3.8rem, 27cqi, 8.25rem);
  letter-spacing: -.025em;
  white-space: nowrap;
  text-shadow: 0 4px 24px #10070c, 0 1px 2px #10070c;
}

h1:focus { outline: none; }

.subtitle {
  margin: .8rem 0 1.55rem;
  color: var(--text);
  font-size: clamp(1.05rem, 1.65vw, 1.38rem);
  font-weight: 650;
  text-shadow: 0 2px 7px #0a0608, 0 1px 2px #0a0608;
}

.contract {
  display: grid;
  gap: .65rem;
  padding: .95rem 1rem;
  background: var(--oxblood);
  border: 1px solid var(--edge);
  border-radius: 4px;
  box-shadow: 0 6px 24px #0b080953;
}

.contract-label, .contract-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-width: 0;
}

.contract-label {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 650;
}

.launch-status {
  color: var(--salmon);
  font-weight: 750;
  white-space: nowrap;
}

.contract-value {
  min-height: 2.8rem;
  border: 1px solid #775157bf;
  border-radius: 2px;
  background: #1b1115;
}

.contract-value code {
  min-width: 0;
  padding: .45rem .72rem;
  color: var(--text);
  font-size: .875rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.contract-value button {
  align-self: stretch;
  flex: 0 0 auto;
  padding-inline: .85rem;
  border: 0;
  border-inline-start: 1px solid var(--edge);
  background: var(--cranberry);
  font-size: .875rem;
  font-weight: 750;
}

.contract-value button:hover:enabled, .contract-value button.copied { background: #c04055; }
.contract-value button:disabled { color: #f2b4ad; background: #713640; cursor: not-allowed; }
.contract-value button:focus-visible { outline-offset: -4px; }

.copy-status { margin: 0; color: var(--muted); font-size: .875rem; }
.copy-status:empty { position: absolute; }

.socials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: .65rem 0 0;
  padding: 0;
  list-style: none;
}

.socials li:last-child { grid-column: 1 / -1; }

.socials a, .social-pending {
  display: flex;
  align-items: center;
  min-height: 2.8rem;
  padding: .5rem .85rem;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: #24171bea;
  font-size: .875rem;
  font-weight: 720;
}

.social-pending { color: var(--muted); }
.socials a { color: var(--text); }
.socials .art-download { background: #592936; }
.socials a:hover { border-color: var(--salmon); background: #542530; }

.chart {
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--pine);
  overflow: hidden;
  box-shadow: 0 13px 42px #08060691;
}

.chart::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--stripe);
}

.chart-header, .chart-label, .chart-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.chart-header {
  min-height: 3.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: .35rem .9rem .35rem 1.05rem;
  border-bottom: 1px solid #775157bf;
  background: var(--oxblood);
}

.chart-header h2 {
  margin: 0;
  color: var(--text);
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.2;
}

.chart-label { flex-wrap: wrap; }

.chart-status {
  padding: .13rem .42rem;
  color: var(--evergreen);
  background: #34483c;
  border-radius: 2px;
  font-size: .8125rem;
  line-height: 1.3;
}

.chart-actions { flex-wrap: wrap; gap: .4rem; }
.chart-actions:has(> :not([hidden])) { padding-block: .15rem; }
.chart-actions:not(:has(> :not([hidden]))) { display: none; }

.chart-actions button, .chart-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .2rem .65rem;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: #372128;
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
}

.chart-actions button:hover:enabled, .chart-actions a:hover { border-color: var(--salmon); background: #542530; }
.chart-actions button:disabled { color: var(--muted); }

.chart-screen {
  display: grid;
  min-height: clamp(42rem, calc(100svh - 12.5rem), 43rem);
  background: var(--pine);
}

.chart-empty, .chart-frame { grid-area: 1 / 1; }

.chart-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .8rem;
  padding: 2rem 1rem;
  color: #c5dcd2;
  background:
    radial-gradient(ellipse at center, #121f1a 0, #121f1a00 52%),
    linear-gradient(0deg, #7ba08e27 1px, transparent 1px) 0 0 / 100% 3.5rem,
    linear-gradient(90deg, #7ba08e24 1px, transparent 1px) 0 0 / 3.5rem 100%;
  text-align: center;
}

.chart-empty p { margin: 0; font-weight: 600; }

.candles {
  display: flex;
  align-items: center;
  gap: .4rem;
  height: 2.2rem;
  color: var(--evergreen);
}

.candles span {
  position: relative;
  width: .44rem;
  height: .8rem;
  border: 1px solid currentColor;
  background: var(--pine);
}

.candles span::before, .candles span::after {
  content: "";
  position: absolute;
  left: calc(50% - .5px);
  width: 1px;
  height: .3rem;
  background: currentColor;
}

.candles span::before { bottom: 100%; }
.candles span::after { top: 100%; }
.candles span:nth-child(1) { transform: translateY(.35rem); color: var(--salmon); }
.candles span:nth-child(2) { height: 1rem; transform: translateY(-.2rem); }
.candles span:nth-child(3) { height: .63rem; transform: translateY(-.43rem); }

.chart-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
}

.footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .45rem 1rem;
  padding-block: 1rem;
  border-top: 1px solid #eac6ab62;
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
  text-shadow: 0 1px 5px #0b0709, 0 1px #0b0709;
}

.audio-player {
  position: fixed;
  z-index: 2;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) minmax(6.4rem, 8rem);
  align-items: center;
  gap: .65rem;
  width: min(24rem, calc(100% - 2rem));
  padding: .55rem .65rem;
  border: 1px solid #cc8782;
  border-radius: 4px;
  background: #221419;
  box-shadow: 0 7px 32px #080405bb;
}

.audio-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ebada1;
  border-radius: 2px;
  background: var(--night);
}

.audio-toggle img { width: 100%; height: 100%; object-fit: cover; }

.audio-action-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #130d11a6;
  font-size: 0;
}

.audio-toggle:hover .audio-action-icon { background: #28211d84; }

.audio-action-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-block: 7px solid transparent;
  border-left: 10px solid var(--text);
}

.audio-toggle[aria-pressed="true"] .audio-action-icon::before {
  width: .63rem;
  height: .8rem;
  margin: 0;
  border: 0;
  border-inline: 3px solid var(--text);
}

.audio-title {
  font-size: .875rem;
  font-weight: 720;
  line-height: 1.15;
}

.volume {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.3rem;
  align-items: center;
  gap: .35rem;
}

.volume-icon { display: none; }

.volume input {
  width: 100%;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--salmon);
  cursor: pointer;
}

.volume output {
  color: var(--muted);
  font-size: .8125rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (any-pointer: fine) {
  body {
    --santa-hat-cursor: url("assets/niomas-santa-cursor.png") 5 7;
    cursor: var(--santa-hat-cursor), auto;
  }

  a[href], button:enabled, .volume input {
    cursor: var(--santa-hat-cursor), pointer;
  }
}

@media (max-width: 58rem) {
  .stage { grid-template-columns: 1fr; gap: 2.7rem; }
  .identity { width: min(100%, 37rem); }
  .chart-screen { min-height: max(29rem, 68svh); }
}

@media (max-width: 38rem) {
  .shell { width: calc(100% - 1.75rem); }
  .meme-wall { background-size: auto, 9.5rem auto; }
  .topbar { min-height: 3.85rem; }
  .stage { padding-block: 2.6rem; }
  .chart-header { padding-inline: .75rem; }
  .footer { flex-wrap: wrap; }
  .audio-player {
    right: max(.875rem, env(safe-area-inset-right));
    bottom: max(.875rem, env(safe-area-inset-bottom));
    width: min(24rem, calc(100% - 1.75rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow::before, .snow::after { animation: none; }
}
