/*
 * Landing page — the marketing/onboarding surface at `/`. Shares the app's
 * design tokens and IBM Plex (imported via base.css in the entry), but is a
 * standalone page bundle: no Zustand, no IndexedDB, no service worker.
 *
 * Syntax-highlight colours for the read-only spec view aren't app tokens (the
 * app uses Monaco's own theme), so they're defined here, on the landing root,
 * with a dark-theme override.
 */
.landing {
  --code-key: #6929c4;
  --code-str: #0e7490;
  --code-num: #1192e8;
}
:global(html[data-theme='dark']) .landing {
  --code-key: #be95ff;
  --code-str: #3ddbd9;
  --code-num: #82cfff;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ---- nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.navIn {
  display: flex;
  align-items: center;
  height: 56px;
  gap: var(--space-5);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brandMark {
  width: 20px;
  height: 20px;
  display: block;
}
.navSpacer {
  margin-left: auto;
}
.navLink {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  margin-right: var(--space-5);
}
.navLink:hover {
  color: var(--text);
}
/* The primary CTA sits a step apart from the theme toggle beside it. */
.navCta {
  margin-left: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding: 0 var(--space-5);
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  background: var(--layer-01);
}
.btnPrimary {
  height: var(--control-height-lg);
  padding: 0 var(--space-6);
  font-size: 15px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.btnPrimary:hover {
  background: var(--accent-hover);
}
/* Compact marketing chrome (nav/footer links, demo affordances). Off the app's
   32/40px control scale on purpose — these are landing-page buttons, not the app's
   Button primitive. */
.btnSm {
  height: 28px;
  padding: 0 var(--space-4);
  font-size: 12px;
}
/* Filled-accent compact button — the Export demo's "Download" affordance. */
.btnFill {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

/* ---- hero ---- */
.hero {
  text-align: center;
  padding: var(--space-9) 0 var(--space-7);
}
.hero h1 {
  font-weight: 300;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.hero h1 b {
  font-weight: 600;
}
.hero p {
  margin: var(--space-5) auto var(--space-7);
  max-width: 56ch;
  font-size: 17px;
  color: var(--text-secondary);
}
.heroCta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
}
.heroNote {
  font-size: 13px;
  color: var(--text-placeholder);
}

/* ---- app-window mock ---- */
.stage {
  padding-bottom: var(--space-9);
}
.stageHint {
  text-align: center;
  margin: var(--space-5) 0 0;
  font-size: 13px;
  color: var(--text-placeholder);
}
.appWin {
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.appWinBar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 40px;
  padding: 0 var(--space-4);
  background: var(--layer-01);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.grow {
  flex: 1;
}
.dots {
  display: flex;
  gap: 5px;
}
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
  display: block;
}
.pill {
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 2px 8px;
}

.appBody {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  /* A fixed height keeps the window on-screen at default scale; each column
     scrolls its own overflow (a long spec, a long library) within it. */
  height: 420px;
}
.appBody > * {
  min-width: 0;
}
.col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.col + .col {
  border-left: 1px solid var(--border);
}
.colHead {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-placeholder);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.libList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.libSearch {
  margin: var(--space-3) var(--space-4);
  height: var(--control-height);
  background: var(--field);
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  color: var(--text-placeholder);
  font-size: 12px;
}
.row {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rowSel {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
.rowName {
  font-size: 13px;
}
/* Inline meta after a dataset name in the Library mock (format · size). */
.rowSub {
  color: var(--text-placeholder);
  font-size: 11px;
}
.rowLast {
  border-bottom: none;
}
.rowMeta {
  font-size: 11px;
  color: var(--text-placeholder);
  margin-top: 2px;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0 4px;
}

.code {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
  overflow: auto;
}
.tokKey {
  color: var(--code-key);
}
.tokStr {
  color: var(--code-str);
}
.tokNum {
  color: var(--code-num);
}

.preview {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--space-5);
}
.chartHost {
  min-height: 180px;
}
/* The node Vega embeds into. It gets `display:inline-block` (`.vega-embed`) at
   runtime, so a definite width is what makes the responsive width:"container"
   fit resolve instead of collapsing to zero. */
.chartNode {
  width: 100%;
  box-sizing: border-box;
}
.chartError {
  display: block;
  padding: var(--space-4);
  font-size: 12px;
  color: var(--support-error);
}

/* ---- capability sections ---- */
.cap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-9);
  align-items: center;
  padding: var(--space-9) 0;
}
.capRev .capText {
  order: 2;
}
.capEyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.capH {
  font-weight: 300;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}
.capH b {
  font-weight: 600;
}
.capP {
  color: var(--text-secondary);
  max-width: 44ch;
  font-size: 15px;
}
.capP + .capP {
  margin-top: var(--space-4);
}

.shot {
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.shotBar {
  height: 32px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  background: var(--layer-01);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}
.shotBody {
  padding: var(--space-5);
}
/* The Library mock fills the panel with flush list rows, so it drops the padding. */
.shotBodyFlush {
  padding: 0;
}

/* builder demo */
.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  margin-bottom: var(--space-5);
}
.seg button {
  padding: 5px var(--space-4);
  font: inherit;
  font-size: 12px;
  border: none;
  border-right: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.seg button:last-child {
  border-right: none;
}
.seg .on {
  background: var(--accent);
  color: var(--accent-contrast);
}
.shelf {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.shelf b {
  width: 52px;
  color: var(--text-secondary);
  font-weight: 500;
}
.select {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--field);
  border: none;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 3px var(--space-3);
  cursor: pointer;
}
.intent {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}
.intent button {
  font: inherit;
  font-size: 11px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  padding: 3px var(--space-3);
  cursor: pointer;
}
.intent .intentOn {
  border-color: var(--accent);
  color: var(--accent);
}
.intent button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* theme demo */
.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.mini {
  border: 1px solid var(--border);
  padding: var(--space-3);
  overflow: hidden;
}
.miniHost {
  min-height: 96px;
}

/* export demo */
.exp {
  max-width: 320px;
}
.expRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  font-size: 13px;
}
.expLab {
  color: var(--text-secondary);
}
.grp {
  display: inline-flex;
  border: 1px solid var(--border-strong);
}
.grp button {
  padding: 4px var(--space-3);
  font: inherit;
  font-size: 12px;
  border: none;
  border-right: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.grp button:last-child {
  border-right: none;
}
.grp .on {
  background: var(--accent);
  color: var(--accent-contrast);
}
.expDownload {
  margin-top: var(--space-5);
}

/* ---- philosophy band ---- */
.creed {
  background: var(--accent-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: var(--space-9);
  padding: var(--space-9) 0;
  text-align: center;
}
.creed h2 {
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.01em;
}
.creed h2 b {
  font-weight: 600;
}
.creedLede {
  color: var(--text-secondary);
  max-width: 56ch;
  margin: var(--space-5) auto var(--space-8);
  font-size: 16px;
}
.creedGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-7);
  text-align: left;
}
.creedGrid h3 {
  font-size: 15px;
  margin-bottom: var(--space-3);
}
.creedGrid p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
.creedKey {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-2);
}

/* ---- closing ---- */
.close {
  text-align: center;
  padding: var(--space-9) 0;
}
.close h2 {
  font-weight: 300;
  font-size: 30px;
  margin-bottom: var(--space-6);
}
.close h2 b {
  font-weight: 600;
}

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-7) 0;
}
.footerIn {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  font-size: 13px;
  color: var(--text-placeholder);
  flex-wrap: wrap;
}
.footerIn a {
  color: var(--text-secondary);
  text-decoration: none;
}
.footerIn a:hover {
  color: var(--text);
}
.footerSp {
  margin-left: auto;
}

@media (max-width: 760px) {
  .appBody {
    grid-template-columns: 1fr;
    height: auto;
  }
  .appBody .col:first-child {
    display: none;
  }
  .col {
    overflow: visible;
  }
  .code {
    max-height: 320px;
  }
  .cap,
  .creedGrid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .capRev .capText {
    order: 0;
  }
}
