/* KStudio Onboarding V2 - Sand to Story. Cream light theme, navy dark theme. */
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-700.woff2') format('woff2'); font-weight: 700; }

:root, [data-theme="light"] {
  --bg: #F6F1E7; --ink: #1F4FD8; --soft: #91A9EC; --bar: #141414;
  --ctl-bg: rgba(246, 241, 231, .82); --ctl-line: rgba(31, 79, 216, .35);
}
[data-theme="dark"] {
  --bg: #0B1230; --ink: #8FADFF; --soft: #43568F; --bar: #05070f;
  --ctl-bg: rgba(11, 18, 48, .82); --ctl-line: rgba(143, 173, 255, .35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden; transition: background .35s ease;
}

/* 16:9 letterboxed stage, same convention as V1. */
.stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#gl {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  display: block; background: var(--bar);
  box-shadow: 0 0 90px rgba(0, 0, 0, .18);
}

/* Storyboard-style caption, bottom-left of the stage. */
.caption {
  position: absolute; left: calc(50% - min(50vw, 50vh * 16 / 9) + 56px);
  bottom: calc(50% - min(50vh, 50vw * 9 / 16) + 48px);
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none; opacity: 0; transition: opacity .4s ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.caption.on { opacity: 1; }
.cap-num { font-size: 12px; letter-spacing: .3em; color: #ffd9a0; }
.cap-title { font-size: 26px; font-weight: 700; letter-spacing: .14em; color: #fff; }
.cap-sub { font-size: 12px; letter-spacing: .08em; color: rgba(255, 255, 255, .72); max-width: 460px; }

.enter-bar {
  position: absolute; left: 50%; bottom: calc(50% - min(50vh, 50vw * 9 / 16) + 120px);
  transform: translateX(-50%); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .6s ease;
}
.enter-bar.on { opacity: 1; pointer-events: auto; }
.enter-btn {
  display: inline-block; padding: 14px 42px; border: 1.5px solid var(--ink);
  color: var(--ink); text-decoration: none; letter-spacing: .28em; font-size: 15px;
  background: var(--ctl-bg); backdrop-filter: blur(4px);
}
.enter-btn:hover { background: var(--ink); color: var(--bg); }
.hint { display: block; margin-top: 10px; font-size: 11px; color: var(--soft); letter-spacing: .06em; }

.progress-wrap {
  position: absolute; left: calc(50% - min(50vw, 50vh * 16 / 9));
  bottom: calc(50% - min(50vh, 50vw * 9 / 16));
  width: min(100vw, calc(100vh * 16 / 9)); height: 3px; background: rgba(128, 128, 128, .18);
}
.progress { height: 100%; width: 0; background: var(--ink); }

.controls { position: fixed; top: 18px; right: 18px; display: flex; gap: 8px; z-index: 10; }
.ctl {
  font: inherit; font-size: 12px; letter-spacing: .08em; cursor: pointer;
  color: var(--ink); background: var(--ctl-bg); border: 1px solid var(--ctl-line);
  padding: 8px 12px; backdrop-filter: blur(4px);
}
.ctl:hover { background: var(--ink); color: var(--bg); }
.ctl.hidden { display: none; }

.foot {
  position: fixed; left: 18px; bottom: 14px; right: 18px; z-index: 10;
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: .06em; color: var(--soft); pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .enter-bar, .caption, body { transition: none; }
}
