/* ---------- Fonts (self-hosted, subset to Latin) ---------- */
@font-face {
  font-family: "Rubik Mono One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Rubik Mono One"),
    url("/assets/fonts/rubik-mono-one.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Space Mono"),
    url("/assets/fonts/space-mono.woff2") format("woff2");
}

/* ---------- Base ---------- */
:root {
  --paper: #f1ead9;
  --paper-shadow: #e4dcc6;
  --ink: #0f0f0f;
  --ink-soft: #1a1a1a;
  --accent: #d9442b;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--paper);
}

body {
  min-height: 100svh;
  background-color: var(--paper);
  background-image:
    radial-gradient(
      circle at 20% 15%,
      rgba(255, 255, 255, 0.55),
      transparent 55%
    ),
    radial-gradient(
      circle at 80% 85%,
      rgba(0, 0, 0, 0.06),
      transparent 60%
    );
  color: var(--ink);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain overlay */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.04  0 0 0 0 0.03  0 0 0 0.28 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2rem)
    clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  min-height: 100svh;
}

/* ---------- Logo ---------- */
.logo {
  width: 100%;
  text-align: center;
  padding-top: clamp(0.5rem, 2vw, 1rem);
}

.logo__img {
  display: inline-block;
  width: auto;
  height: auto;
  max-width: min(320px, 60vw);
  max-height: clamp(72px, 12vw, 140px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  aspect-ratio: 640 / 511;
}

/* ---------- Lede (above hero) ---------- */
.lede {
  width: 100%;
  max-width: 640px;
  text-align: center;
  padding: 0 0.5rem;
  margin-top: clamp(-0.25rem, 0.5vw, 0.5rem);
}

.lede__text {
  margin: 0;
  font-family: "Rubik Mono One", "Space Mono", monospace;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: clamp(0.25rem, 1.5vw, 1rem);
}

.hero__image {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  aspect-ratio: 1120 / 894;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.04));
}

/* ---------- Copy ---------- */
.copy {
  max-width: 560px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0 0.5rem;
}

.copy__body {
  margin: 0;
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  color: var(--ink-soft);
  max-width: 46ch;
}

/* ---------- Coming Soon badge ---------- */
.badge {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: "Rubik Mono One", "Space Mono", monospace;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: rotate(1deg);
}

/* Anchor variant used when the page detects a web3 wallet and swaps the
   badge into a link to the Sauce docs. */
a.badge,
.badge--link {
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.badge:hover,
.badge--link:hover,
a.badge:focus-visible,
.badge--link:focus-visible {
  transform: rotate(1deg) translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
  outline: none;
}

a.badge:active,
.badge--link:active {
  transform: rotate(1deg) translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.badge__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 68, 43, 0.25);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.82);
    opacity: 0.7;
  }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding-top: 2rem;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 15, 15, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer__sep {
  opacity: 0.5;
}

/* ---------- View toggle (only mounted when a web3 wallet is detected) ---------- */
.view-toggle {
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.25rem);
  left: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 10;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-family: "Rubik Mono One", "Space Mono", monospace;
  font-size: clamp(0.65rem, 1.3vw, 0.78rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.view-toggle:hover,
.view-toggle:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
  outline: none;
}

.view-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* ---------- Motion prefs ---------- */
@media (prefers-reduced-motion: reduce) {
  .badge__dot {
    animation: none;
  }
}
