/* rumor.trade landing — approved design (Predict background: A · dotwave).
   Everything here is the visual layer from the design task (spec §5.8). */

/* ---------- Fonts ---------- */
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/IBMPlexMono-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/IBMPlexMono-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/IBMPlexMono-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Neurial Grotesk"; src: url(fonts/NeurialGrotesk-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Neurial Grotesk"; src: url(fonts/NeurialGrotesk-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* Perps (from the Perps app globals.css) */
  --bp-blue: #0b2d6e;
  --bp-blue-deep: #071f4f;
  --bp-ink: #f3ecd2;
  --bp-ink-sub: rgba(243, 236, 210, 0.8);
  --bp-ink-dim: rgba(243, 236, 210, 0.62);
  --bp-line: rgba(243, 236, 210, 0.34);
  --bp-frame: rgba(243, 236, 210, 0.42);
  --bp-grid-minor: rgba(243, 236, 210, 0.07);
  --bp-grid-major: rgba(243, 236, 210, 0.14);
  --bp-yellow: #ffd84a;
  --bp-yellow-hover: #ffe37a;

  /* Predict (from live rumor.trade CSS) */
  --pr-bg: #090607;
  --pr-bg-2: #131313;
  --pr-bg-3: #212223;
  --pr-border: #2e2e30;
  --pr-text: #ffffff;
  --pr-text-2: #eaeaea;
  --pr-text-3: #a0a0a0;
  --pr-text-4: #6c7278;
  --pr-cyan: #00d9ff;
  --pr-violet: #cf86ff;
  --pr-ice: #9ef0ff;

  /* Type & size scale: desktop values reached at 1920 px, mobile values below 768 px */
  --title: clamp(30px, 2.9vw, 60px);
  --sub: clamp(15px, 1.05vw, 21px);
  --btn-h: clamp(46px, 2.75vw, 56px);
  --btn-fs: clamp(13px, 0.8vw, 16px);
  --gap-title: clamp(16px, 1.25vw, 26px);
  --gap-actions: clamp(26px, 1.9vw, 40px);
  --block: clamp(300px, 30vw, 620px);
  --inset: clamp(14px, 1.7vw, 36px);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --t-widen: 400ms;
  --t-enter: 600ms;
  --dim: 0.42;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
body {
  background: var(--pr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.split { display: flex; min-height: 100vh; min-height: 100dvh; }
.half {
  position: relative;
  isolation: isolate;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: flex-grow var(--t-widen) var(--ease-out);
}
.content { position: relative; z-index: 2; width: var(--block); flex: none; }

.title {
  display: flex;
  align-items: center;
  gap: 0.36em;
  font-size: var(--title);
  line-height: 1;
  white-space: nowrap;
}
.mark { width: 1.14em; height: 1.14em; flex: none; display: block; }
.sub { margin-top: var(--gap-title); font-size: var(--sub); }
.sub span { display: block; text-wrap: balance; }
.actions { display: flex; flex-wrap: wrap; gap: clamp(12px, 0.85vw, 16px); margin-top: var(--gap-actions); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  padding: 0 1.9em;
  font-size: var(--btn-fs);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid transparent;
}
.btn.trade, .btn.docs { min-width: 10em; }
.btn:focus { outline: none; }

/* ---------- Perps half ---------- */
.perps {
  background-color: var(--bp-blue);
  background-image:
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(var(--bp-grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: var(--inset) var(--inset);
  color: var(--bp-ink);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
.content { margin-bottom: 40px; } /* optical centre: lifts both blocks clear of the Perps title strip, keeps the halves aligned */

/* Sheet frame with centre ticks and corner overshoot */
.sheet {
  position: absolute;
  inset: var(--inset);
  z-index: 1;
  border: 1px solid var(--bp-frame);
  pointer-events: none;
}
.sheet::before, .sheet::after {
  content: "";
  position: absolute;
  inset: -11px;
  background-repeat: no-repeat;
}
.sheet::before {
  --c: linear-gradient(var(--bp-frame), var(--bp-frame));
  background-image: var(--c), var(--c), var(--c), var(--c);
  background-size: 1px 21px, 1px 21px, 21px 1px, 21px 1px;
  background-position: 50% 0, 50% 100%, 0 50%, 100% 50%;
}
.sheet::after {
  --c: linear-gradient(var(--bp-frame), var(--bp-frame));
  background-image: var(--c), var(--c), var(--c), var(--c), var(--c), var(--c), var(--c), var(--c);
  background-size: 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px;
  background-position:
    left 0 top 10px, left 10px top 0,
    right 0 top 10px, right 10px top 0,
    left 0 bottom 10px, left 10px bottom 0,
    right 0 bottom 10px, right 10px bottom 0;
}
.strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--bp-frame);
  background: var(--bp-blue);
  color: var(--bp-ink-dim);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.perps .title { font-weight: 600; letter-spacing: -0.02em; }
.perps .sub { color: var(--bp-ink-sub); line-height: 1.6; letter-spacing: 0; }
.perps .btn { font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; border-radius: 0; }
.perps .trade {
  background: var(--bp-yellow);
  color: var(--bp-blue-deep);
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.perps .trade:hover { background: var(--bp-yellow-hover); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 0 var(--bp-ink); }
.perps .trade:active { background: var(--bp-ink); transform: translate(1px, 1px); box-shadow: 0 0 0 0 var(--bp-ink); transition-duration: 60ms; }
.perps .trade:focus-visible { outline: 2px solid var(--bp-ink); outline-offset: 4px; }
.perps .docs {
  background: var(--bp-blue);
  border-color: rgba(243, 236, 210, 0.5);
  color: var(--bp-ink);
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.perps .docs:hover { background: #1e3c76; border-color: var(--bp-ink); }   /* ink 8% over blue, opaque so the grid stays hidden */
.perps .docs:active { background: #304c7e; transform: translate(1px, 1px); transition-duration: 60ms; }   /* ink 16% over blue */
.perps .docs:focus-visible { outline: 2px solid var(--bp-ink); outline-offset: 4px; }

/* ---------- Predict half ---------- */
.predict {
  background: var(--pr-bg);
  color: var(--pr-text);
  font-family: "Neurial Grotesk", "Inter", system-ui, sans-serif;
}
.predict .title { font-weight: 500; letter-spacing: -0.035em; }
.predict .sub { color: var(--pr-text-3); line-height: 1.5; letter-spacing: -0.005em; }
.predict .btn { font-weight: 500; font-size: calc(var(--btn-fs) + 1px); letter-spacing: -0.01em; border-radius: 10px; }
.predict .trade {
  background: var(--pr-text);
  color: var(--pr-bg);
  transition: transform 140ms var(--ease-out), box-shadow 200ms var(--ease-out), background-color 140ms var(--ease-out);
}
.predict .trade:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 10px 34px -10px rgba(158, 240, 255, 0.55), 0 8px 30px -14px rgba(207, 134, 255, 0.75);
}
.predict .trade:active { background: #dadada; transform: scale(0.97); box-shadow: none; transition-duration: 60ms; }
.predict .trade:focus-visible { outline: 2px solid var(--pr-cyan); outline-offset: 3px; }
.predict .docs {
  background: var(--pr-bg-2);
  border-color: var(--pr-border);
  color: var(--pr-text-2);
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.predict .docs:hover { background: var(--pr-bg-3); border-color: #3c3c3f; color: var(--pr-text); }
.predict .docs:active { background: #2a2b2d; transform: scale(0.97); transition-duration: 60ms; }
.predict .docs:focus-visible { outline: 2px solid var(--pr-cyan); outline-offset: 3px; }

/* Predict background: halftone dotwave on the outer edge (light SVG, rendered once), fading into black before the text */
.predict .bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url(img/dotwave.svg) no-repeat right -40px center / auto max(112%, 900px);
}

/* ---------- Cursors (mouse only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .perps, .perps * { cursor: url(img/cursor-perps.svg) 16 16, crosshair; }
  .predict, .predict * { cursor: url(img/cursor-predict.svg) 6 4, default; }
}

/* ---------- Widening + dim (mouse, ≥1280 px, motion allowed) ---------- */
.half::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-widen) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) and (min-width: 1280px) and (prefers-reduced-motion: no-preference) {
  .split:has(.perps:hover) .perps,
  .split:has(.predict:hover) .predict,
  .split:not(:has(.half:hover)):has(.perps:focus-within) .perps,
  .split:not(:has(.half:hover)):has(.predict:focus-within) .predict { flex-grow: 1.5; }

  .split:has(.perps:hover) .predict::after,
  .split:has(.predict:hover) .perps::after,
  .split:not(:has(.half:hover)):has(.perps:focus-within) .predict::after,
  .split:not(:has(.half:hover)):has(.predict:focus-within) .perps::after { opacity: var(--dim); }
}

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .content { animation: enter var(--t-enter) var(--ease-out) both; }
  .predict .content { animation-delay: 90ms; }
  .sheet, .predict .bg { animation: fade 900ms ease-out both; }
}
@keyframes enter { from { opacity: 0.01; transform: translateY(14px); } } /* 0.01, not 0: Chrome records first paint only for content that is not fully transparent */
@keyframes fade { from { opacity: 0.01; } }

/* ---------- Phones: stacked halves, each half of the dynamic viewport ---------- */
@media (max-width: 767.98px) {
  :root {
    --title: 30px;
    --sub: 15px;
    --btn-h: 46px;
    --btn-fs: 13px;
    --gap-title: 14px;
    --gap-actions: 22px;
    --inset: 12px;
  }
  .split { flex-direction: column; }
  .half { flex: none; min-height: 50vh; min-height: 50dvh; padding: 40px 32px; }
  .strip { display: none; } /* spec §5.2: the title-block line exists only side by side (≥ 768 px) */
  .content { margin-bottom: 0; }
  .content { width: 100%; max-width: 440px; }
  .btn.trade { min-width: 0; flex: 1 1 0; }
  .btn.docs { flex: 1 1 0; }
}
@media (max-width: 767.98px) {
  .predict .bg { background-position: right -260px center; background-size: auto 720px; }
}
