/* =====================================================================
   $IBM — Internet, Blockchain, Money
   One screen. No scrolling on desktop; the whole layout is sized off the
   viewport (vh/vmin) rather than fixed px so it shrinks instead of
   overflowing on short laptops.
   ===================================================================== */

:root {
  --bg:        #05070c;
  --bg-2:      #070b14;
  --panel:     #0a1120;
  --panel-2:   #0c1526;
  --line:      #16233a;
  --line-hot:  #23406b;

  --ink:       #e7edf7;
  --ink-dim:   #92a2bd;
  --ink-mute:  #5d6d88;

  --blue:      #1f70c1;   /* the coin's blue */
  --blue-hot:  #4f9dff;
  --blue-soft: #9ec5ff;
  --blue-deep: #0b2d5c;

  --green:     #3fd48a;
  --amber:     #f2b544;

  --px: 'Press Start 2P', 'JetBrains Mono', monospace;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 4px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;                 /* desktop: nothing to scroll to */

  /* Faint blueprint grid + a cold glow behind the hero. */
  background-image:
    radial-gradient(120% 90% at 22% 12%, rgba(31,112,193,.16), transparent 62%),
    radial-gradient(90% 80% at 88% 88%, rgba(11,45,92,.28), transparent 60%),
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }

/* Pixel art must stay pixels. */
.coin, .brand__coin { image-rendering: pixelated; }

::selection { background: var(--blue); color: #fff; }

/* --- CRT dressing ---------------------------------------------------- */

.scanlines,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.16) 0px, rgba(0,0,0,.16) 1px,
    transparent 1px, transparent 3px
  );
  opacity: .5;
  mix-blend-mode: multiply;
}

.vignette {
  background: radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(0,0,0,.72) 100%);
}

/* --- shell ------------------------------------------------------------ */

.shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 clamp(14px, 2.6vw, 40px);
}

/* --- header ----------------------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(12px, 2.2vh, 22px) 0 clamp(10px, 1.6vh, 16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand__coin {
  width: clamp(30px, 4vh, 42px);
  height: auto;
  filter: drop-shadow(0 0 10px rgba(79,157,255,.35));
}

.brand__name {
  font-family: var(--px);
  font-size: clamp(8px, 1.15vh, 12px);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__name i { color: var(--blue-hot); font-style: normal; margin: 0 .25em; }

.bar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chain {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 11px;
  background: rgba(10,17,32,.72);
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(63,212,138,.16);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* contract chip ------------------------------------------------------- */

.ca {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  padding: 6px 11px;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .1s;
  min-width: 0;
}
.ca:hover { border-color: var(--blue); background: linear-gradient(180deg, #0e1a2f, var(--panel-2)); }
.ca:active { transform: translateY(1px); }

.ca__label {
  font-size: 9.5px;
  letter-spacing: .14em;
  color: var(--blue-soft);
  border-right: 1px solid var(--line-hot);
  padding-right: 9px;
}
.ca__value { letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca__icon { color: var(--ink-mute); display: flex; }
.ca:hover .ca__icon { color: var(--blue-hot); }

/* --- stage ------------------------------------------------------------ */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, .94fr);
  align-items: center;
  gap: clamp(20px, 3.4vw, 56px);
  min-height: 0;
  padding: clamp(10px, 2vh, 26px) 0;
}

/* left: the pitch ------------------------------------------------------ */

.pitch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
  min-width: 0;
}

.coin {
  width: clamp(110px, 23vh, 268px);
  height: auto;
  filter: drop-shadow(0 0 34px rgba(79,157,255,.32));
  animation: bob 5.5s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) }
  50%      { transform: translateY(-7px) }
}

.wordmark {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.4vw, 22px);
  flex-wrap: nowrap;
}

.wordmark__ticker {
  font-family: var(--px);
  font-size: clamp(32px, 7.4vh, 78px);
  line-height: 1;
  color: #fff;
  text-shadow:
     3px 3px 0 var(--blue-deep),
     0 0 26px rgba(79,157,255,.45);
  letter-spacing: -.02em;
}

.wordmark__expand {
  font-family: var(--px);
  font-size: clamp(8px, 1.55vh, 14px);
  line-height: 1.9;
  color: var(--ink-dim);
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-bottom: .2em;
}
.wordmark__expand b { color: var(--blue-hot); font-weight: 400; }

.tagline {
  font-family: var(--px);
  font-size: clamp(10px, 2.05vh, 19px);
  line-height: 1.85;
  white-space: nowrap;
  margin: clamp(12px, 2.2vh, 22px) 0 0;
  color: var(--ink);
  text-transform: uppercase;
}
.tagline__buy  { color: var(--blue-hot); }
.tagline__earn { color: var(--green); }

.caret {
  display: inline-block;
  width: .62em;
  height: 1em;
  margin-left: .34em;
  background: var(--blue-hot);
  vertical-align: -.12em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }

.blurb {
  margin: clamp(10px, 1.8vh, 18px) 0 0;
  max-width: 46ch;
  font-size: clamp(13px, 1.85vh, 17.5px);
  color: var(--ink-dim);
}
.blurb b { color: var(--ink); font-weight: 700; }

/* buttons -------------------------------------------------------------- */

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: clamp(16px, 2.8vh, 28px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--px);
  font-size: clamp(9.5px, 1.42vh, 13px);
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  padding: clamp(13px, 2.2vh, 21px) clamp(18px, 2.1vw, 30px);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s, box-shadow .16s, background .16s, border-color .16s, color .16s;
  white-space: nowrap;
}

.btn--buy {
  color: #fff;
  background: linear-gradient(180deg, #2f86dd, var(--blue));
  border-color: #59a8f5;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 6px 0 -1px #0c3d75, 0 14px 34px rgba(31,112,193,.34);
}
.btn--buy:hover {
  background: linear-gradient(180deg, #3f96ee, #2278cd);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 6px 0 -1px #0c3d75, 0 18px 44px rgba(31,112,193,.5);
}
.btn--buy:active { transform: translateY(3px); box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 3px 0 -1px #0c3d75; }

.btn--ghost {
  color: var(--ink-dim);
  background: rgba(10,17,32,.6);
  border-color: var(--line-hot);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--blue); background: var(--panel-2); }
.btn--ghost:active { transform: translateY(1px); }

/* right: the rewards panel --------------------------------------------- */

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(18,32,56,.62), rgba(8,13,24,.86));
  border: 1px solid var(--line-hot);
  border-radius: 6px;
  padding: clamp(18px, 3vh, 32px) clamp(18px, 2vw, 34px) clamp(16px, 2.6vh, 28px);
  box-shadow:
    inset 0 1px 0 rgba(120,169,255,.12),
    0 24px 60px rgba(0,0,0,.55);
  min-width: 0;
}

/* corner ticks — the "screen inside a screen" cue */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid var(--blue);
  opacity: .75;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: clamp(10px, 1.6vh, 16px);
  border-bottom: 1px solid var(--line);
}

.panel__head h2 {
  margin: 0;
  font-family: var(--px);
  font-size: clamp(8.5px, 1.3vh, 12px);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--blue-soft);
  font-weight: 400;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--green);
}
.live[data-state="stale"] { color: var(--amber); }
.live[data-state="stale"] .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(242,181,68,.16); }

.readout {
  padding: clamp(16px, 3vh, 32px) 0 clamp(14px, 2.4vh, 26px);
  text-align: center;
}

.readout__num {
  font-family: var(--px);
  font-size: clamp(27px, 6.1vh, 62px);
  line-height: 1.06;
  color: #fff;
  text-shadow: 0 0 22px rgba(79,157,255,.55), 2px 2px 0 var(--blue-deep);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.readout__unit {
  margin-top: clamp(7px, 1.2vh, 12px);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--ink-mute);
}

.readout__usd {
  margin-top: clamp(6px, 1vh, 10px);
  font-family: var(--px);
  font-size: clamp(11px, 1.85vh, 18px);
  color: var(--green);
  text-shadow: 0 0 18px rgba(63,212,138,.35);
}

/* stat grid ------------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cell {
  background: rgba(6,10,19,.82);
  padding: clamp(10px, 1.9vh, 18px) clamp(11px, 1.1vw, 16px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cell__k {
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

.cell__v {
  font-family: var(--px);
  font-size: clamp(10px, 1.7vh, 15px);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell--next .cell__v { color: var(--amber); }
.cell--next[data-imminent="1"] .cell__v { color: var(--green); animation: blink-soft 1s steps(2) infinite; }
@keyframes blink-soft { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* reward token line ----------------------------------------------------- */

.reward-token {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(10px, 1.6vh, 15px);
  padding: 9px 12px;
  border: 1px dashed var(--line-hot);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 11.5px;
  color: var(--ink-dim);
  transition: border-color .16s, color .16s;
  min-width: 0;
}
.reward-token:hover { border-color: var(--blue); color: var(--ink); }
.reward-token__k { letter-spacing: .1em; text-transform: uppercase; font-size: 9.5px; color: var(--ink-mute); white-space: nowrap; }
.reward-token__v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- ticker ----------------------------------------------------------- */

.ticker {
  border-top: 1px solid var(--line);
  background: rgba(5,8,14,.7);
  overflow: hidden;
}

.ticker__rail {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
  padding: clamp(8px, 1.3vh, 13px) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.ticker__run {
  display: inline-flex;
  gap: 0;
  will-change: transform;
  animation: marquee 60s linear infinite;
}
.ticker__rail:hover .ticker__run { animation-play-state: paused; }
/* the rail holds two identical copies, so -50% is exactly one lap */
@keyframes marquee {
  from { transform: translateX(0) }
  to   { transform: translateX(-50%) }
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--ink-dim);
  padding: 0 22px;
  border-right: 1px solid var(--line);
}
.tick__addr { color: var(--blue-soft); }
.tick__amt  { color: var(--green); font-weight: 700; }
.tick__ago  { color: var(--ink-mute); font-size: 10.5px; }
.tick--empty { color: var(--ink-mute); }

/* --- toast ------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translate(-50%, 14px);
  background: var(--blue);
  color: #fff;
  font-family: var(--px);
  font-size: 9.5px;
  letter-spacing: .06em;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(31,112,193,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 60;
  text-transform: uppercase;
}
.toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }

/* --- focus ------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--blue-hot);
  outline-offset: 3px;
}

/* --- narrow / short viewports ----------------------------------------- */

@media (max-width: 1080px) {
  .stage { grid-template-columns: 1fr; gap: clamp(16px, 2.6vh, 26px); align-content: center; }
  .panel { max-width: 560px; width: 100%; }
  .blurb { max-width: 60ch; }
}

@media (max-width: 900px), (max-height: 620px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; }
}

@media (max-width: 900px) {
  .bar { flex-wrap: wrap; }
  .bar__right { width: 100%; justify-content: space-between; }
  .ca { flex: 1; min-width: 0; }
  .stage { padding: 22px 0 26px; }
  .pitch { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .coin { width: clamp(112px, 30vw, 150px); }
  .wordmark { justify-content: center; align-items: center; }
  .wordmark__expand { text-align: left; }
  .blurb { margin-inline: auto; }
  .cta { justify-content: center; }
  .cta .btn { flex: 1 1 190px; }
  .panel { margin-inline: auto; }
  .toast { bottom: 26px; }
}

@media (max-width: 460px) {
  .wordmark { flex-direction: column; gap: 10px; }
  .coin { width: clamp(96px, 26vw, 130px); }
  .tagline { font-size: 11px; }
  .readout__num { font-size: clamp(24px, 8.4vw, 34px); }
  .wordmark__expand { text-align: center; }
  .chain { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .coin, .caret, .dot, .ticker__run, .cell--next .cell__v { animation: none !important; }
}
