/* MarketTape landing page. The tokens are the app's own (globals.css in the app): the ground, the text
   tiers, the accent, the chart ease and the ears' spring. */

@font-face {
  font-family: "Elms Sans";
  src: url("fonts/elms-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --canvas: #0A0A0B;
  --canvas-rgb: 10 10 11;
  --fg: #EDEDEF;
  --fg-muted: #B1B1B8;
  --fg-subtle: #8A8A93;
  --fg-faint: #4B4B52;
  --accent: #7B93FF;
  --on-accent: #0A0B14;
  /* Tooltips: ink a step above the ground, cut out by a hairline */
  --tip: #18181B;
  --tip-line: rgb(255 255 255 / 0.12);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fold: cubic-bezier(0.3, 0, 0.15, 1);
  /* The ears' spring from the app: one overshoot, a small settle */
  --spring: linear(0, 0.009 1.5%, 0.035 3%, 0.082 4.8%, 0.144 6.5%, 0.287 9.8%, 0.584 15.8%, 0.714 18.5%, 0.831 21.2%, 0.923 23.8%, 1 26.2%, 1.061 28.7%, 1.106 31.2%, 1.137 33.8%, 1.153 35.8%, 1.162 38%, 1.155 43%, 1.129 47.5%, 1.021 61.8%, 0.995 66.8%, 0.98 71.8%, 0.975 82.5%, 0.995 99.8%, 1);

  --pad: clamp(20px, 3.4vw, 56px);
  --top: clamp(64px, 10vh, 96px);
  --foot: clamp(56px, 8.5vh, 76px);
  --h1: clamp(40px, min(7.4vw, 10.6vh), 120px);
  --lede: clamp(15px, min(1.32vw, 2.3vh), 19px);
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--canvas);
  color: var(--fg);
  font: 400 15px/1.5 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: var(--on-accent); }

/* One screen, three bands: the brand, the message, the company */
.page {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: var(--top) 1fr var(--foot);
  padding: 0 var(--pad);
  pointer-events: none;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* The logo: the elephant drawn inline so its ears can move, the wordmark as outlines. Under the pointer
   the elephant spreads its ears, as it does in the app */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  height: 40px;
  color: var(--fg);
  pointer-events: auto;
}
a.brand { text-decoration: none; border-radius: 8px; outline: none; }
a.brand:focus-visible { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent); }
.brand .mark { width: 27.35px; height: 30px; flex-shrink: 0; overflow: visible; fill: currentColor; }
.brand .wordmark { width: 120px; height: 24px; flex-shrink: 0; display: block; }

.ear { transform-box: view-box; transition: transform 340ms var(--ease-fold); }
.ear-l { transform-origin: 36.9px 101.9px; }
.ear-r { transform-origin: 98.9px 96.3px; transition-delay: 30ms; }
@media (hover: hover) {
  .brand:is(:hover, :focus-visible) .ear {
    transition: transform 640ms cubic-bezier(0.34, 1.45, 0.64, 1);
    transition: transform 640ms var(--spring);
  }
  .brand:is(:hover, :focus-visible) .ear-l { transform: rotate(-8deg); }
  .brand:is(:hover, :focus-visible) .ear-r { transform: rotate(8deg); transition-delay: 45ms; }
}

/* The wall of screens (depth.js) and the veil that gives the words calm ground: the table falls away to
   the left, behind them, and at both edges. depth.js reads the veil's stops to keep the focus clear of it:
   change them in both places */
.wall { position: fixed; inset: 0; z-index: 0; }
.wall canvas { display: block; width: 100%; height: 100%; }
.wall-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(var(--canvas-rgb)) 0%, rgb(var(--canvas-rgb) / 0.94) 28%, rgb(var(--canvas-rgb) / 0.62) 48%, rgb(var(--canvas-rgb) / 0) 66%),
    linear-gradient(0deg, rgb(var(--canvas-rgb)) 0%, rgb(var(--canvas-rgb) / 0) 20%),
    linear-gradient(180deg, rgb(var(--canvas-rgb) / 0.8) 0%, rgb(var(--canvas-rgb) / 0) 16%);
}

/* The screen in focus, named above its top left bracket */
.focus-tag {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--tip);
  box-shadow: inset 0 0 0 1px var(--tip-line);
  color: var(--fg);
  font-size: 12px;
  line-height: 24px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.focus-tag .focus-note { color: var(--fg-subtle); }

/* The message */
.hero {
  align-self: center;
  max-width: min(820px, 50vw);
  padding-bottom: 2vh;
}
.hero h1 {
  margin: 0;
  font-family: "Elms Sans", "Geist", ui-sans-serif, sans-serif;
  font-weight: 500;
  font-size: var(--h1);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero .lede {
  margin: clamp(16px, 2.8vh, 32px) 0 0;
  max-width: 38em;
  color: var(--fg-muted);
  font-size: var(--lede);
  line-height: 1.55;
  text-wrap: balance;
}
.hero .w { display: inline-block; }

/* The chains, as the app draws them: each chain's own tile, overlapping, cut free by a ring of the ground */
.chains {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(20px, 3.4vh, 36px) 0 0;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 20px;
}
.chain-stack { display: inline-flex; pointer-events: auto; }
.chain {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 0 0 2px var(--canvas);
  transition: transform 180ms var(--ease);
}
.chain + .chain { margin-left: -6px; }
.chain svg { display: block; }
.chain-dark { box-shadow: 0 0 0 2px var(--canvas), inset 0 0 0 1px rgb(255 255 255 / 0.12); }
.chain-bnb, .chain-robinhood { background: #000000; }
.chain-ethereum { background: #627EEA; }
.chain-base { background: #0000FF; }
.chain-hyperevm { background: #072723; }
/* Under the pointer a tile rises and names its chain */
.chain::after {
  content: attr(data-name);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  padding: 0 8px;
  border-radius: 6px;
  background: var(--tip);
  box-shadow: inset 0 0 0 1px var(--tip-line);
  color: var(--fg);
  font-size: 12px;
  line-height: 24px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
  pointer-events: none;
}
@media (hover: hover) {
  .chain:hover { transform: translateY(-3px); z-index: 1; }
  .chain:hover::after { opacity: 1; transform: translate(-50%, 0); }
}

/* Tall screens: the table above, the words under it */
@media (max-aspect-ratio: 11/10) {
  .veil {
    background:
      linear-gradient(0deg, rgb(var(--canvas-rgb)) 0%, rgb(var(--canvas-rgb) / 0.94) 36%, rgb(var(--canvas-rgb) / 0.4) 56%, rgb(var(--canvas-rgb) / 0) 72%),
      linear-gradient(180deg, rgb(var(--canvas-rgb) / 0.8) 0%, rgb(var(--canvas-rgb) / 0) 16%);
  }
  .hero { align-self: end; max-width: 620px; padding-bottom: clamp(12px, 3vh, 40px); }
}

/* The company, quietly */
.legal {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  font: 400 12px/16px "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--fg-subtle);
  white-space: nowrap;
}
/* The address stays on one line; where the row is too narrow, the email moves under it */
.legal address { font-style: normal; display: flex; gap: 4px 12px; min-width: 0; }
.legal .entity { color: var(--fg-muted); }
.legal .sep { color: var(--fg-faint); }
.legal .contact { display: flex; align-items: center; gap: 12px; }
.legal a {
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  border-radius: 4px;
  outline: none;
  pointer-events: auto;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}
.legal a:hover { color: var(--fg); text-decoration-color: currentColor; }
.legal a:focus-visible { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent); }

@media (max-width: 720px) {
  .legal { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; white-space: normal; }
  .legal .sep { display: none; }
  .legal address { flex-wrap: wrap; gap: 0 10px; }
  .legal .year { display: none; }
}
@media (max-height: 520px) {
  .hero .lede { display: none; }
  .chains { margin-top: 16px; }
}

/* Not found */
.lost .hero { max-width: 640px; }
.lost .hero h1 { --h1: clamp(40px, min(6vw, 9vh), 88px); }
.home {
  display: inline-flex;
  align-items: center;
  height: 40px;
  margin-top: clamp(20px, 3.4vh, 36px);
  padding: 0 16px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--canvas);
  font-weight: 500;
  text-decoration: none;
  pointer-events: auto;
  outline: none;
  transition: background-color 160ms var(--ease);
}
.home:hover { background: #FFFFFF; }
.home:focus-visible { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent); }

/* The opening: the elephant inks itself in while the screens load, then takes its place in the corner.
   Without script there is no opening and nothing waits for it */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: var(--canvas);
}
.js .intro { display: grid; }
.intro svg { width: 65.64px; height: 72px; overflow: visible; color: var(--fg); }
.intro .ink-front { fill: var(--accent); }
/* The corner mark waits for the flying one to land on it */
.js:not(.is-landed) .brand .mark { opacity: 0; }

/* Things that rise in once the screen is ready, each after its own delay */
.js [data-rise] {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
}
.is-ready [data-rise] {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity 900ms var(--ease) var(--d, 0ms),
    transform 1100ms var(--ease) var(--d, 0ms),
    filter 900ms var(--ease) var(--d, 0ms);
}

/* Should the script never run, the page shows itself after a few seconds all the same */
.js:not(.is-ready) .intro { animation: give-up 1ms 10s forwards; }
.js:not(.is-ready) [data-rise], .js:not(.is-landed) .brand .mark { animation: show-anyway 1ms 10s forwards; }
@keyframes give-up { to { visibility: hidden; } }
@keyframes show-anyway { to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .js [data-rise] { opacity: 1; transform: none; filter: none; }
  .is-ready [data-rise] { transition: none; }
  .ear, .chain, .chain::after { transition: none; }
  .ear { transform: none !important; }
}

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