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

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

:root {
  color-scheme: dark;
  --cream: #fae9cf;
  --beige: #ddc3a6;
  --brass: #e4ba83;
  --accent: #ff876e;
  --line: #e6ba8936;
  --wine: #a33429;
  --display: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  background: #24140e;
  color: var(--cream);
  font-family: var(--sans);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, iframe:focus-visible {
  outline: 2px solid #ffc983;
  outline-offset: 4px;
}
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  min-block-size: 100vh;
  min-block-size: 100svh;
  display: grid;
  grid-template: auto 1fr auto / minmax(0, 1fr);
  isolation: isolate;
  background: #24140e;
}

.page-width {
  inline-size: min(100% - 2 * clamp(1.25rem, 6.7vw, 8rem), 100rem);
  margin-inline: auto;
}

.topbar {
  z-index: 1;
  padding-top: env(safe-area-inset-top);
  background: #25150f;
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-block-size: 4.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  line-height: 1;
}

.brand img { border-radius: 0.35rem; box-shadow: 0 0 0 1px #e6ba8950; }

.navigation { display: flex; align-items: center; gap: clamp(0.7rem, 2.8vw, 2.6rem); }
.navigation button,
.case-trigger {
  padding: 0;
  min-block-size: 2.75rem;
  border: 0;
  background: transparent;
  color: var(--beige);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 160ms ease;
}

.navigation button:hover, .case-trigger:hover { color: #fff3e1; }

.courtroom {
  min-block-size: 35.25rem;
  display: grid;
  align-items: center;
  position: relative;
  isolation: isolate;
}

.scenery {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  background: #2f1a12;
  z-index: -1;
  pointer-events: none;
}

.scenery::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #1d100ad4 0%, #21120bad 32%, #23120a42 53%, transparent 68%),
    linear-gradient(0deg, #25150f63, transparent 26%);
}

.artboard {
  position: absolute;
  width: max(100cqw, calc(100cqh * 1672 / 941));
  aspect-ratio: 1672 / 941;
  inset-inline-start: 50%;
  inset-block-start: 0;
  translate: -50% 0;
}

.scene-layer, .scene-layer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mascot {
  position: absolute;
  width: 39.5%;
  height: auto;
  inset-inline-start: 56%;
  inset-block-start: 5.2%;
  filter: drop-shadow(6px 12px 12px #16080459);
}

.hero-frame { padding-block: 1.6rem 2rem; }
.hero { position: relative; inline-size: min(49vw, 41rem); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: var(--brass);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before { content: ''; width: 1.6rem; height: 1px; background: currentColor; }

h1, h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; }
h1 {
  margin: 0.64rem 0 1rem;
  font-size: clamp(4.5rem, min(8.15vw, 13.3svh), 9rem);
  line-height: 0.82;
  letter-spacing: -0.024em;
  text-shadow: 0 0.08em 0.2em #200f0970;
}

h1 span, h1 em { display: block; }
h1 em { font-style: normal; color: var(--accent); }

.token { display: flex; align-items: center; gap: 0.7rem; }
.token strong { font-family: var(--mono); font-size: 1rem; letter-spacing: 0.065em; }
.network {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.21rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #21130d65;
  color: #ebcfaf;
  font-size: 0.8125rem;
}

.network svg { color: #e2b27a; }
.hero-copy {
  max-inline-size: 25.5rem;
  margin: 0.95rem 0 1.28rem;
  color: #f0d7bb;
  font-size: clamp(1rem, 1.33vw, 1.18rem);
  line-height: 1.44;
  text-wrap: pretty;
}

.hero-actions, .verdict-options { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.button {
  min-block-size: 3.18rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.058em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary { background: var(--wine); border-color: #db6f54; color: #fff1dd; }
.primary[href]:hover, button.primary:hover { background: #b94939; }
.primary[aria-disabled='true'] { cursor: default; background: #812c24; border-color: #c0644e; }
.secondary { background: #2d1a11be; border-color: #e4b88765; color: var(--cream); }
.secondary:hover { background: #462719; border-color: #edbe8abb; }

.contract {
  display: flex;
  align-items: center;
  position: relative;
  gap: 0.72rem;
  width: min(100%, 27.1rem);
  min-block-size: 3.1rem;
  margin-top: 0.85rem;
  padding: 0.37rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #1b100bc9;
}

.contract-tag {
  flex: none;
  padding-inline-end: 0.72rem;
  border-inline-end: 1px solid var(--line);
  color: var(--brass);
  font: 700 0.875rem var(--mono);
}

.contract-value {
  flex: 1;
  overflow: hidden;
  color: #f3d9bd;
  font: 400 clamp(0.75rem, 1.07vw, 0.81rem) var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.contract[data-pending] .contract-value { text-transform: uppercase; }
.copy-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-block-size: 2rem;
  padding: 0.2rem 0.36rem;
  border: 0;
  background: transparent;
  color: var(--brass);
  font-size: 0.82rem;
  font-weight: 700;
}

.copy-button:hover { color: #fff3e1; }
.copy-error {
  position: absolute;
  z-index: 1;
  inset: calc(100% + 0.3rem) 0 auto;
  padding: 0.45rem 0.75rem;
  border: 1px solid #b46b52;
  border-radius: 3px;
  background: #2d1a11;
  font-size: 0.85rem;
}

.case-trigger { display: inline-flex; gap: 0.5rem; align-items: center; margin-top: 0.26rem; }
.case-trigger svg, .secondary svg { flex: none; color: #e6b983; }

.footer {
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: #25150f;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  min-block-size: 3.75rem;
  padding-block: 0.6rem;
}

.footer p { max-inline-size: 44rem; margin: 0; color: #cfb397; font-size: 0.8125rem; line-height: 1.4; }
.socials { display: flex; align-items: center; gap: 0.4rem; }
.social-link {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: #e6c6a5;
  transition: color 160ms ease, transform 160ms ease;
}

.social-link:hover { color: #fff0db; transform: translateY(-2px); }
.social-link span {
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}

html:has(dialog[open]) { overflow: hidden; }
.dialog {
  position: fixed;
  max-block-size: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  border-radius: 5px;
  box-shadow: 0 24px 80px #100703a6;
}

.dialog[open] { animation: dialog-in 170ms ease-out both; }
.dialog::backdrop { background: #130b08ce; }
@keyframes dialog-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

.close-button {
  position: absolute;
  z-index: 2;
  inset: 0.7rem 0.7rem auto auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: transparent;
  opacity: 0.8;
}

.close-button:hover { opacity: 1; }
.close-button::before, .close-button::after {
  content: '';
  grid-area: 1 / 1;
  width: 1rem;
  height: 1.5px;
  background: currentColor;
  rotate: 45deg;
}

.close-button::after { rotate: -45deg; }
.paper {
  color-scheme: light;
  padding: clamp(1.35rem, 4vw, 3rem);
  border: 1px solid #9c6845;
  background:
    radial-gradient(ellipse at 9% 0%, #fff8e18c, transparent 70%),
    repeating-linear-gradient(5deg, #684a2c08 0 1px, transparent 1px 5px),
    #f0e2ca;
  color: #35251d;
  overflow: auto;
}

.paper .eyebrow { color: #8e3326; }
.paper :focus-visible { outline-color: #893527; }
.paper h2 { margin: 0.25rem 0 0.85rem; font-size: clamp(3rem, 7vw, 5rem); line-height: 0.94; }
.case-dialog { width: min(calc(100% - 2rem), 50rem); }
.case-content { display: grid; grid-template-columns: 1.08fr 0.92fr; align-items: center; gap: clamp(1.2rem, 4.2vw, 3.15rem); }
.case-text p:not(.eyebrow) { margin: 0.75rem 0 0; line-height: 1.48; }
.case-lede { font-size: 1.2rem; font-weight: 700; }
.case-note { padding-top: 0.75rem; border-top: 1px solid #8e6e5555; font-size: 0.875rem; }
.exhibit { margin: 1.15rem 0 0; padding: 0.55rem; border: 1px solid #9d755c7d; background: #f9edd8; }
.exhibit img { display: block; width: 100%; height: auto; }
.exhibit figcaption {
  padding: 0.45rem 0.1rem 0.08rem;
  color: #862f26;
  font: 700 0.875rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.verdict-dialog { width: min(calc(100% - 2rem), 32rem); }
.verdict-dialog h2 { max-width: 22rem; }
.verdict-dialog .secondary { color: #553424; border-color: #94614a; background: #fbecd4; }
.verdict-dialog .secondary:hover { background: #f5d8b8; }
.verdict-options button[aria-pressed='true'] { box-shadow: 0 0 0 2px #f0e2ca, 0 0 0 4px #933d2e; }
.verdict-reaction { min-block-size: 4.75rem; display: grid; place-items: center; padding-top: 0.85rem; }
#verdict-stamp:not(:empty) {
  padding: 0.23rem 0.8rem 0.37rem;
  border: 3px double currentColor;
  color: #a33429;
  font: 900 clamp(1.35rem, 5.5vw, 2rem) / 1 var(--display);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  rotate: -6deg;
}

#verdict-stamp[data-verdict='raw'] { color: #5b5e3a; rotate: 5deg; }
#verdict-stamp.stamping { animation: stamp-in 220ms cubic-bezier(.15, .72, .29, 1.2) both; }
@keyframes stamp-in { from { opacity: 0; scale: 1.35; } to { opacity: 1; scale: 1; } }

.chart-dialog {
  width: min(calc(100% - 1.5rem), 85rem);
  max-width: none;
  padding: 3.45rem 0.55rem 0.55rem;
  border: 1px solid #6c4a36;
  background: #251a16;
  color: var(--cream);
}

.chart-dialog .close-button { inset: 0.35rem 0.55rem auto auto; }
.chart-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  height: min(44rem, calc(100dvh - 6.2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  background: #101117;
}

.chart-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chart-message { padding: 0 1rem; color: #f0d7bb; text-align: center; }
.chart-fallback { padding: 0.7rem; color: #efbd91; }

@media (min-width: 801px) and (max-width: 1100px) {
  .page-width { inline-size: calc(100% - 5.5rem); }
  .hero { inline-size: min(49vw, 29rem); }
  h1 { font-size: min(8.85vw, 12.5svh); }
  .mascot { width: 37.5%; inset-block-start: 8.7%; }
}

@media (max-width: 800px) {
  .page-width { inline-size: min(100% - 2.5rem, 34rem); }
  .topbar-inner { min-block-size: 3.75rem; gap: 0.55rem; }
  .brand { gap: 0.45rem; font-size: 1.15rem; white-space: nowrap; }
  .brand img { width: 1.625rem; height: 1.625rem; }
  .navigation { gap: clamp(0.55rem, 2vw, 1.15rem); }
  .navigation button { font-size: 0.8125rem; letter-spacing: 0.045em; }
  .nav-your { display: none; }
  .courtroom {
    --mobile-art-width: 32rem;
    --mobile-art-offset: 4.85rem;
    align-items: start;
    min-block-size: 40.5rem;
  }
  .scenery { background: radial-gradient(ellipse at center bottom, #53301d 0%, #2a170f 64%); }
  .scenery::after { background: linear-gradient(180deg, #24140e61, #25150f3d 33%, transparent 55%, transparent 91%, #25150f45); }
  .artboard {
    width: min(100cqw, var(--mobile-art-width));
    aspect-ratio: 941 / 1672;
    inset-block-start: auto;
    inset-block-end: calc(-1 * var(--mobile-art-offset));
    mask-image: linear-gradient(180deg, transparent, black 12%);
  }
  .mascot { width: 85%; inset-inline-start: 7%; inset-block-start: 36.5%; }
  .hero-frame { padding: 1.2rem 0 calc(min(100vw, var(--mobile-art-width)) * 1.128 - var(--mobile-art-offset) + 0.5rem); }
  .hero { inline-size: min(100%, 26rem); margin-inline: auto; }
  .eyebrow { font-size: 0.8125rem; letter-spacing: 0.115em; }
  .eyebrow::before { width: 1.15rem; }
  h1 { margin: 0.53rem 0 0.68rem; font-size: clamp(3.75rem, 13.2vw, 5.3rem); }
  .hero-copy { margin: 0.65rem 0 0.8rem; }
  .hero-actions { flex-wrap: nowrap; }
  .button { min-block-size: 2.75rem; padding-inline: 0.84rem; }
  .contract { margin-top: 0.65rem; min-block-size: 2.7rem; }
  .case-trigger { display: none; }
  .footer-inner { flex-wrap: wrap; gap: 0.1rem 1rem; padding-block: 0.7rem; }
  .socials { order: -1; }
}

@media (min-width: 550px) and (max-width: 800px) {
  .courtroom { min-block-size: 47rem; }
  .artboard {
    mask-image: linear-gradient(180deg, transparent, black 12%), linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    mask-composite: intersect;
  }
  .hero-frame { padding-top: 2.1rem; }
}

@media (max-width: 375px) {
  .page-width { inline-size: calc(100% - 2rem); }
  .topbar-inner { gap: 0.35rem; }
  .brand { font-size: 1.04rem; letter-spacing: 0.035em; }
  .navigation button { letter-spacing: 0; }
  .nav-the { display: none; }
  h1 { font-size: clamp(3.15rem, 14.2vw, 3.75rem); }
  .button { padding-inline: 0.65rem; font-size: 0.8125rem; }
}

@media (max-width: 600px) {
  .case-content { grid-template-columns: 1fr; }
  .exhibit { margin-top: 0; }
  .exhibit img { max-block-size: 23rem; object-fit: cover; }
}

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