/* Idle Gains site. Same tokens as the app (lib/core/theme): yellow is the
   only brand color, on white or black. Flat: no gradients, blur or glows. */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --dim: #6e6e69;
  --line: #e0e0db;
  --raised: #f5f5f2;
  --night: #0a0a0a;
  --night-ink: #f5f5f2;
  --night-dim: #8c8c87;
  --yellow: #ffd60a;
  --yellow-edge: #c9a600;
  /* The scene's time of day, and the text on it; walk.js sets them. */
  --sky: #ffffff;
  --sky-ink: #111111;
  --sky-dim: #6e6e69;
  --ui: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --px: 'Silkscreen', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --bar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }

/* Short pixel labels: Silkscreen caps, 1-3 words. */
.kicker, .label, .chip, .stamp, .hint, .mark span, .key {
  font-family: var(--px);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.kicker, .label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.kicker::before, .label::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--yellow);
}

/* ---------- Top bar ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--bar-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sky);
  color: var(--sky-ink);
  transition: color 500ms;
}
body.dark .bar { background: var(--night); }
.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}
.mark img { border-radius: 6px; }

/* KeyCap: a solid lip under the key that it sinks into when pressed. */
.key {
  display: inline-block;
  padding: 12px 20px 11px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--yellow-edge);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 60ms, box-shadow 60ms;
}
.key:active { transform: translateY(4px); box-shadow: 0 0 0 var(--yellow-edge); }
.key-sm { padding: 9px 14px 8px; font-size: 13px; box-shadow: 0 3px 0 var(--yellow-edge); }
.key-sm:active { transform: translateY(3px); }

/* ---------- The walk ---------- */

.js .walk { height: var(--walk-h, 900vh); }
.stage {
  position: relative;
  overflow: hidden;
  background: var(--sky);
  color: var(--sky-ink);
}
.js .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  /* Sideways swipes are the scene's (they scroll it, in walk.js). */
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}
.world {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
html:not(.js) .world, html:not(.js) .hud, html:not(.js) .hint { display: none; }
html:not(.js) .captions { padding: calc(var(--bar-h) + 40px) var(--gutter) 40px; display: grid; gap: 48px; }

.js .captions {
  position: absolute;
  top: calc(var(--bar-h) + 3vh);
  left: var(--gutter);
  right: var(--gutter);
  pointer-events: none;
}
.js .cap {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 820px;
}
.cap h1 { font-size: clamp(44px, 7.2vw, 104px); line-height: 0.95; font-weight: 800; }
.cap h2 { font-size: clamp(30px, 4.1vw, 60px); line-height: 1; font-weight: 800; max-width: 18em; }
.cap p { margin-top: 16px; font-size: clamp(18px, 1.7vw, 24px); font-weight: 500; color: var(--sky-dim); max-width: 30em; }
.cap .kicker { margin: 0 0 18px; color: var(--sky-ink); font-size: 13px; font-weight: 400; }
.cap .key { margin-top: 28px; }

/* Each line of a caption slides up into place, one after another. */
.js .cap > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 120ms, transform 120ms, color 500ms;
}
.js .cap.on { pointer-events: auto; }
.js .cap.on > * {
  opacity: 1;
  transform: none;
  transition: opacity 260ms, transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1), color 500ms;
}
.js .cap.on > :nth-child(2) { transition-delay: 70ms; }
.js .cap.on > :nth-child(3) { transition-delay: 140ms; }
.js .cap.on > :nth-child(4) { transition-delay: 210ms; }

/* Inside the dungeon the whole page goes dark. A hard cut, like the game.
   (Outside, the sky's color and the text on it follow the time of day.) */
body.dark { background: var(--night); }
body.dark .bar, body.dark .stage { color: var(--night-ink); }
body.dark .stage { background: var(--night); }
body.dark .cap p { color: var(--night-dim); }
body.dark .cap .kicker { color: var(--night-ink); }

/* ---------- HUD ---------- */

/* The strip under the world; walk.js sets --band to its height. */
.hud {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--band, 72px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.hud > * { display: none; }
.hud > .on { display: flex; }
.hud-raid { gap: 8px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: #1f1f1f;
  color: var(--night-ink);
  font-size: 12px;
}
.chip b { color: var(--yellow); font-weight: 700; }
.chip[hidden] { display: none; }
/* The way home: who's raiding with him, in their colors, and how much
   faster that makes the clock. */
.party { gap: 4px; }
.party i { width: 6px; height: 6px; background: var(--yellow); }
.party .blue { background: #0099db; }
.party .red { background: #e43b44; }
.party[data-n="2"] .red { display: none; }
.party b { margin-left: 4px; }
.timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: #1f1f1f;
  color: var(--yellow);
  font: 700 15px/1 var(--ui);
  font-variant-numeric: tabular-nums;
}
.bar-track { display: block; width: 72px; height: 6px; background: #333; }
.bar-fill { display: block; height: 100%; width: 100%; background: var(--yellow); }
.hud-gold {
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 8px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--yellow);
  font: 700 18px/1 var(--ui);
  font-variant-numeric: tabular-nums;
}
.hud-gold img { width: 32px; height: 32px; image-rendering: pixelated; }
.hud-skills { gap: 10px; margin-top: -4px; }
.skill {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--raised);
  box-shadow: 0 4px 0 var(--line);
  transition: transform 60ms, box-shadow 60ms;
}
.skill img { width: 32px; height: 32px; image-rendering: pixelated; }
.skill.down { transform: translateY(4px); box-shadow: 0 0 0 var(--line); background: var(--yellow); }
/* A skill being learned: its slot empty, then lit as it lands. */
.skill.empty img { visibility: hidden; }
.skill.new { background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-edge); }
.skill.learn { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; transition: none; }
/* Cooldown: a shade that drains away from the top, like the app's slots. */
.skill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  transform: scaleY(var(--cd, 0));
  transform-origin: bottom;
}
.stamp {
  position: absolute;
  left: 50%;
  bottom: 46vh;
  transform: translateX(-50%);
  padding: 10px 18px 8px;
  background: var(--yellow);
  color: var(--ink);
  font-size: clamp(22px, 3.6vw, 44px);
  font-weight: 700;
  white-space: nowrap;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: max(20px, 4vh);
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--sky-dim);
  transition: opacity 200ms, color 500ms;
}
.hint::after { content: ' ↓'; animation: blink 1s steps(1) infinite; }
/* After the party: there's more to see on the way back. */
.hud-back { font-family: var(--px); font-size: 12px; text-transform: uppercase; color: var(--sky-dim); }
.hud-back::after { content: ' ↑'; animation: blink 1s steps(1) infinite; }
.hint.off { opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Info ---------- */

.info, .beta {
  padding: clamp(80px, 12vw, 160px) var(--gutter);
  max-width: 1200px;
  margin: 0 auto;
}
.info .label { color: var(--dim); margin-bottom: 40px; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 24px; }
.steps h3 { font-size: 28px; margin: 24px 0 10px; }
.steps h3::before { content: '0' counter(step) '  '; font-family: var(--px); font-size: 14px; letter-spacing: 0; vertical-align: 4px; white-space: pre; }
.steps p { color: var(--dim); }
.px-icon { width: 64px; height: 64px; image-rendering: pixelated; }
.px-strip { object-fit: cover; object-position: 0 0; animation: strip 480ms steps(4, jump-none) infinite; }
@keyframes strip { to { object-position: 100% 0; } }

.rules { padding-top: 0; }
.rules dl { margin: 0; }
.rules dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.rules dt { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.rules dd { margin: 0; color: var(--dim); align-self: center; }

.beta {
  max-width: none;
  padding-left: max(var(--gutter), calc((100% - 1200px) / 2 + var(--gutter)));
  background: var(--night);
  color: var(--night-ink);
}
.beta .label { color: var(--night-dim); margin-bottom: 28px; }
.beta h2 { font-size: clamp(36px, 5.6vw, 80px); line-height: 1; font-weight: 800; max-width: 12em; }
.beta p { margin-top: 18px; color: var(--night-dim); font-size: 20px; }
.beta .key { margin-top: 32px; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--gutter);
  background: var(--night);
  color: var(--night-dim);
  font-size: 14px;
  border-top: 1px solid #292929;
}
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--night-ink); }
.foot nav { display: flex; gap: 20px; }

/* ---------- A plain page (privacy) ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--bar-h) + clamp(40px, 8vw, 96px)) var(--gutter) clamp(80px, 12vw, 140px);
}
.doc-art { display: flex; gap: 4px; margin-bottom: 28px; }
.doc .kicker { color: var(--dim); margin-bottom: 16px; }
.doc h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; }
.doc-date { margin-top: 18px; color: var(--dim); font-size: 15px; }
.doc section { margin-top: 48px; }
.doc h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.15; margin-bottom: 12px; }
.doc h3 { font-size: 19px; margin: 24px 0 6px; letter-spacing: -0.01em; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 0; padding-left: 20px; }
.doc li + li { margin-top: 8px; }
.doc ul + p { margin-top: 16px; }
.doc a { color: inherit; text-decoration: underline; text-decoration-color: var(--yellow-edge); text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* The short version: a flat card with the brand's yellow edge. */
.doc .doc-short { margin-top: 40px; padding: 24px 24px 26px; background: var(--raised); border-top: 4px solid var(--yellow); }
.doc-short h2 { font-family: var(--px); font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 14px; }

/* A phone: the raid row, with the party chip, still fits across. */
@media (max-width: 440px) {
  .hud-raid { gap: 5px; }
  .chip, .timer { gap: 6px; padding: 0 8px; }
  .party { gap: 3px; }
  .bar-track { width: 40px; }
  .chip { white-space: nowrap; }
}
@media (max-width: 380px) {
  .bar-track { display: none; }
}

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .rules dl > div { grid-template-columns: 1fr; gap: 6px; }
  .cap p { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .cap > *, .js .cap.on > * { transition: none; }
  .hint::after, .px-strip { animation: none; }
}
