:root {
  --bg: #05060c;
  --bg-panel: #0d0f1a;
  --ink: #d8dcea;
  --ink-dim: #7d84a0;
  --ink-bright: #ffffff;
  --accent: #ffd9a0;
  --border: #262d48;
  --star: rgba(255, 255, 255, 0.9);
  --up: #7fd6a2;
  --down: #e08a8a;
  --font-ui: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

html[data-theme='light'] {
  --bg: #f3f1ea;
  --bg-panel: #fbfaf6;
  --ink: #2a2c38;
  --ink-dim: #83859a;
  --ink-bright: #101120;
  --accent: #b8742a;
  --border: #d8d4c8;
  --star: rgba(90, 95, 130, 0.55);
  --up: #2c8a58;
  --down: #b4514f;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Starfield */
.stars {
  pointer-events: none;
  position: fixed;
  inset: -100px;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 22px 34px, var(--star), transparent),
    radial-gradient(1px 1px at 128px 90px, var(--star), transparent),
    radial-gradient(1.5px 1.5px at 210px 160px, var(--star), transparent),
    radial-gradient(1px 1px at 76px 205px, var(--star), transparent),
    radial-gradient(1px 1px at 176px 251px, var(--star), transparent);
  background-size: 260px 280px;
  animation: twinkle 5s ease-in-out infinite alternate;
}

.stars-2 {
  background-image:
    radial-gradient(1px 1px at 55px 120px, var(--star), transparent),
    radial-gradient(1.5px 1.5px at 300px 40px, var(--star), transparent),
    radial-gradient(1px 1px at 240px 300px, var(--star), transparent),
    radial-gradient(1px 1px at 150px 370px, var(--star), transparent);
  background-size: 390px 410px;
  animation-duration: 7.5s;
  animation-delay: 1.7s;
}

@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

/* HUD */
.hud {
  position: fixed;
  z-index: 5;
  font-family: var(--font-ui);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-left { top: 18px; left: 20px; color: var(--ink-bright); }
.hud-dim { color: var(--ink-dim); }

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.1); color: var(--accent); }

/* ---------- page ---------- */
.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 20px 40px;
}

/* masthead */
.masthead { text-align: center; margin-bottom: 40px; }

.drifter {
  width: 150px;
  height: 150px;
  margin: 0 auto 4px;
  transition: transform 0.6s ease-out;
  /* blend on the wrapper: its own transform would otherwise isolate an inner blend */
  mix-blend-mode: screen;
}

.astro-cat {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: drift 9s ease-in-out infinite;
}

html[data-theme='light'] .drifter { mix-blend-mode: multiply; }
html[data-theme='light'] .astro-cat { filter: invert(1); }

@keyframes drift {
  0%   { transform: translateY(0) rotate(-5deg); }
  50%  { transform: translateY(-14px) rotate(4deg); }
  100% { transform: translateY(0) rotate(-5deg); }
}

h1 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  margin: 0 0 10px;
  color: var(--ink-bright);
}

.tagline {
  color: var(--ink-dim);
  margin: 0;
  font-size: 14px;
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
}

.manifesto {
  max-width: 600px;
  margin: 14px auto 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}

.loop-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.loop-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
  font-family: var(--font-ui);
}

.loop-chip b {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.loop-chip span { font-size: 11px; color: var(--ink-dim); }

.loop-arrow { color: var(--ink-dim); font-size: 13px; }
@media (max-width: 700px) { .loop-arrow { display: none; } }

/* ---------- blocks: flat, calm, readable ---------- */
.block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 18px;
}

.block-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.block-sub {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-dim);
  margin-left: 8px;
}

.block-text { margin: 0; font-size: 15px; white-space: pre-wrap; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.grid2 .block { margin-bottom: 0; }

@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* dream text */
.dream-meta {
  font-family: var(--font-ui);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.dream-meta .form-tag { color: var(--accent); }

.dream-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink-bright);
  margin: 0 0 12px;
}

.dream-body {
  white-space: pre-wrap;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.75;
}

.memory-text { font-style: normal; }
.fixation-text { color: var(--accent); }

/* telemetry */
.telemetry-text .tele-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.telemetry-text .tele-row:last-child { border-bottom: none; }
.up { color: var(--up); }
.down { color: var(--down); }

.decision-text { color: var(--ink-bright); }

/* hunt board */
.theses-list { white-space: normal; }

.thesis { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.thesis:first-child { padding-top: 2px; }
.thesis:last-child { border-bottom: none; padding-bottom: 2px; }

.thesis-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
}

.dir {
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.dir-buy   { color: var(--up); border-color: var(--up); }
.dir-sell  { color: var(--down); border-color: var(--down); }
.dir-watch { color: var(--accent); border-color: var(--accent); }
.dir-hold  { color: var(--ink-dim); }

.t-symbol { font-weight: 700; font-size: 14.5px; color: var(--ink-bright); }

.t-conv { margin-left: auto; font-size: 11px; color: var(--ink-dim); letter-spacing: 0.06em; }

.t-why { margin: 7px 0 0; font-size: 14px; line-height: 1.6; }

.t-dead {
  margin: 5px 0 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
}

.token-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.token-note a { color: var(--accent); text-decoration: none; }

/* wallet */
.wallet-box { white-space: normal; }

.wallet-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.wallet-row:last-child { border-bottom: none; }

.wallet-row a { color: var(--accent); text-decoration: none; font-size: 13px; }

.wallet-sol { font-weight: 700; color: var(--ink-bright); }

.trades { margin-top: 12px; }

.trades-title {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 6px;
}

.trade-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border);
}
.trade-row:last-child { border-bottom: none; }
.trade-row a { color: var(--accent); text-decoration: none; }
.trades-empty { font-size: 13px; color: var(--ink-dim); font-family: var(--font-ui); }

/* ---------- the sky of dreams ---------- */
.dream-sky-wrap { margin-top: 34px; }

.sky-title { margin-bottom: 4px; }

.sky-hint {
  font-family: var(--font-ui);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin: 0 0 10px;
}

.dream-sky {
  position: relative;
  height: 50vh;
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-panel);
  overflow: hidden;
}

.sky-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sky-lines line {
  stroke: var(--star);
  stroke-width: 1;
  opacity: 0.28;
  stroke-dasharray: 3 4;
}

.sky-star {
  position: absolute;
  background: none;
  border: none;
  padding: 10px; /* generous hit area */
  cursor: pointer;
  line-height: 0;
  transform: translate(-50%, -50%);
}

.sky-star i {
  display: block;
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: var(--star);
  box-shadow: 0 0 8px var(--star);
  animation: star-breathe 4s ease-in-out infinite;
}

.sky-star.s2 i { width: 6px; height: 6px; }
.sky-star.s3 i { width: 7.5px; height: 7.5px; }
.sky-star.latest i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.sky-star:hover i { transform: scale(2); background: var(--accent); box-shadow: 0 0 14px var(--accent); }

@keyframes star-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.star-title {
  position: absolute;
  transform: translate(-50%, 12px);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  pointer-events: none;
}

.star-title.latest { color: var(--accent); }

.sky-label {
  position: absolute;
  transform: translate(-50%, -190%);
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-bright);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  pointer-events: none;
}

.sky-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ---------- modal: a dream, opened ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(3, 4, 10, 0.65);
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--accent); }

.modal-decision {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.footer {
  text-align: center;
  color: var(--ink-dim);
  margin: 48px 0 10px;
  font-size: 13px;
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
}

.footer .disclaimer {
  max-width: 560px;
  margin: 0 auto;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  opacity: 0.75;
}

/* ------- the easter egg -------
   Rapidly toggle day/night a few times. She notices. */
.egg-cat {
  position: fixed;
  bottom: -160px;
  right: -160px;
  z-index: 50;
  width: 130px;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: egg-flight 7s ease-in-out forwards;
}

html[data-theme='light'] .egg-cat {
  mix-blend-mode: multiply;
  filter: invert(1);
}

.egg-meow {
  position: fixed;
  bottom: 150px;
  right: 40px;
  z-index: 51;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--ink-bright);
  opacity: 0;
  animation: egg-meow 7s ease-in-out forwards;
}

@keyframes egg-flight {
  0%   { transform: translate(0, 0) rotate(0deg); }
  20%  { transform: translate(-190px, -190px) rotate(-380deg); }
  45%  { transform: translate(-160px, -230px) rotate(-350deg); }
  70%  { transform: translate(-200px, -200px) rotate(-370deg); }
  100% { transform: translate(60px, -420px) rotate(-320deg); }
}

@keyframes egg-meow {
  0%, 25% { opacity: 0; }
  35%, 65% { opacity: 1; }
  80%, 100% { opacity: 0; }
}
