/* StumbleBots. System fonts, one accent, no external resources. */
:root {
  --ink: #1c2430;
  --muted: #5a6675;
  --accent: #0b7285;
  --teal-dark: #0b7285;
  --accent-ink: #ffffff;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e3ddd2;
  --soft: #f1ede4;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.sr { position: absolute; left: -9999px; }

.site-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; max-width: 1120px; margin: 0 auto;
}
.brand { font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-head nav a { margin-left: 18px; text-decoration: none; font-weight: 600; }

main { max-width: 1120px; margin: 0 auto; padding: 0 22px 40px; }

.hero { text-align: center; padding: 34px 10px 10px; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero .sub { max-width: 640px; margin: 0 auto 20px; color: var(--muted); font-size: 1.08rem; }

.big-btn {
  background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer;
  font-size: 1rem; font-weight: 700; padding: 12px 26px; border-radius: 999px;
}
.big-btn:hover { filter: brightness(1.08); }
.link-btn { display: inline-block; text-decoration: none; }

.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 26px 0 18px; }
.controls input[type="search"] {
  flex: 1 1 260px; padding: 12px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.chips { display: flex; gap: 8px; }
.chip, .pool-chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 18px; border-radius: 999px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.chip.active, .pool-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.pools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 24px 0 16px; }

.stage-wrap { max-width: 760px; margin: 0 auto; }
.stage {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; text-align: center;
}
.stage .tags { margin-bottom: 4px; }
.stage-name { font-size: 2.3rem; line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.02em; }
.stage-pitch { font-size: 1.18rem; max-width: 560px; margin: 0 auto 20px; }
.proof-label {
  display: block; font-style: normal; font-weight: 700; font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px;
}
.stage-actions { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.stage-nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 16px; }
.stage-pos { color: var(--muted); font-weight: 600; margin: 0; }
.stage-hint { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }

.stage-examples {
  background: var(--soft); border-radius: 10px;
  padding: 12px 16px 10px; margin: 0 auto 22px; max-width: 560px;
}
.examples-head {
  display: flex; justify-content: center; align-items: baseline;
  gap: 8px; flex-wrap: wrap;
}
.stage-examples .proof-label { display: inline-block; margin: 0; }
.examples-note { color: var(--muted); font-size: 0.78rem; }
.example-bullet {
  display: flex; align-items: center; justify-content: center;
  min-height: 2.75em; margin: 7px auto 5px;
  font-weight: 600; line-height: 1.35;
}
.example-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 30px;
}
.example-arrow {
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--accent);
  font-size: 1.25rem; font-weight: 700; line-height: 1; padding: 0 0 2px;
}
.example-dots { display: flex; align-items: center; gap: 7px; }
.example-dot {
  width: 9px; height: 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--muted); background: transparent; padding: 0;
}
.example-dot.active { background: var(--accent); border-color: var(--accent); }
.example-count { color: var(--muted); font-size: 0.8rem; font-weight: 600; min-width: 32px; }

/* Homepage only: the whole stumble loop lives inside one viewport. */
.stage-page { height: 100dvh; overflow: hidden; }
.stage-page .one-screen {
  height: 100dvh; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.stage-page .site-head {
  flex: 0 0 auto; width: 100%; padding-top: 10px; padding-bottom: 10px;
}
.stage-page .stage-main {
  flex: 1 1 auto; min-height: 0; width: 100%;
  padding-bottom: 0; display: flex; flex-direction: column;
}
.stage-headline {
  flex: 0 0 auto; text-align: center; letter-spacing: -0.02em;
  font-size: clamp(1.05rem, 5vw, 1.65rem); line-height: 1.12;
  margin: 2px 0 4px; white-space: nowrap;
}
.stage-page .pools { flex: 0 0 auto; margin: 6px 0 10px; }
.stage-page .pool-chip { padding: 7px 17px; }
.stage-page .stage-wrap {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; flex-direction: column;
}
.stage-page .stage {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(14px, 3dvh, 28px) clamp(16px, 4vw, 28px);
}
.stage-page .stage-name {
  font-size: clamp(1.7rem, 6vw, 2.3rem); margin: 5px 0 8px;
}
.stage-page .stage-pitch {
  font-size: clamp(1rem, 2.6vw, 1.14rem); line-height: 1.4;
  margin-bottom: 14px;
}
.stage-page .stage-examples { flex: 0 0 auto; width: 100%; margin-bottom: 16px; }
.stage-page .stage-actions { flex: 0 0 auto; }
.stage-page .stage-nav { flex: 0 0 auto; margin-top: 10px; }
.stage-page .stage-hint { flex: 0 0 auto; font-size: 0.82rem; margin-top: 7px; }
.stage-page .site-foot {
  flex: 0 0 auto; margin-top: 0; padding: 8px 16px;
  font-size: 0.86rem;
}
.stage-page .site-foot p { max-width: none; }
.stage-page .site-foot a { margin-left: 12px; font-weight: 600; text-decoration: none; }

/* A4/A5: Treasure Hunter video on the stage. A5 makes it the pitch:
   taller media, a one-line tagline under it, and a sound toggle chip. */
.stage-page .stage-media {
  flex: 0 0 auto; position: relative;
  width: 100%; height: clamp(130px, 24dvh, 220px);
  border-radius: 12px; overflow: hidden; margin: 0 auto 10px;
  background: #f6ead2;
}
.stage-page .stage-media video {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center 38%;
}
.stage-page .sound-chip {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  background: rgba(28, 36, 48, 0.82); color: #fff; border: 0; cursor: pointer;
  font-size: 0.8rem; font-weight: 700; padding: 7px 13px; border-radius: 999px;
}
.stage-page .sound-chip:hover { background: var(--accent); }
@media (max-width: 819px) {
  .stage-page .stage.has-media .stage-pitch {
    font-size: clamp(0.95rem, 2.4vw, 1.05rem); line-height: 1.32; margin-bottom: 9px;
  }
  .stage-page .stage.has-media .stage-name { margin: 3px 0 5px; }
  .stage-page .stage.has-media .stage-examples { padding: 8px 14px 7px; margin-bottom: 10px; }
  .stage-page .stage.has-media .example-bullet { margin: 4px auto 3px; }
  .stage-page .stage.has-media .stage-media { margin-bottom: 7px; }
  /* A5: the taller media needs room, so the page chrome around a
     has-media stage tightens too (headline, chips, hint, stage padding). */
  .stage-page:has(.stage.has-media) .stage-headline { font-size: 1rem; margin: 0 0 2px; }
  .stage-page:has(.stage.has-media) .pools { margin: 4px 0 8px; }
  .stage-page:has(.stage.has-media) .pool-chip { padding: 6px 15px; }
  .stage-page:has(.stage.has-media) .stage-hint { display: none; }
  .stage-page .stage.has-media { padding-top: 12px; padding-bottom: 12px; }
  .stage-page:has(.stage.has-media) .stage-nav { margin-top: 8px; }
}
@media (min-width: 820px) {
  .stage-page .stage.has-media {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "media tags"
      "media name"
      "media pitch"
      "media examples"
      "media actions";
    column-gap: 26px; align-content: center; justify-content: stretch;
    text-align: center;
  }
  .stage-page .stage.has-media .stage-media {
    grid-area: media; height: auto; aspect-ratio: 16 / 9;
    margin: 0; align-self: center;
  }
  .stage-page .stage.has-media .stage-pitch { margin-bottom: 10px; }
  .stage-page .stage.has-media .stage-examples { margin-bottom: 12px; }
  .stage-page .stage.has-media .tags { grid-area: tags; }
  .stage-page .stage.has-media .stage-name { grid-area: name; }
  .stage-page .stage.has-media .stage-pitch { grid-area: pitch; align-self: start; }
  .stage-page .stage.has-media .stage-examples { grid-area: examples; }
  .stage-page .stage.has-media .stage-actions { grid-area: actions; }
}

/* A6: full-screen feed mode (Treasure Hunter only). The portrait pitch
   fills the screen; everything else is an overlay on the video. */
body.feed-on .one-screen { display: none; }
.feed {
  position: fixed; inset: 0; overflow: hidden; background: #f6ead2; z-index: 60;
}
@media (min-width: 760px) {
  .feed { left: 50%; right: auto; width: min(56.25dvh, 560px); transform: translateX(-50%); }
}
body.feed-on { overflow: hidden; }
.feed video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.feed-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: center; align-items: center;
  gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}
.feed-pools { margin: 0; flex-wrap: nowrap; }
.feed-pools .pool-chip {
  background: rgba(255, 255, 255, 0.78); padding: 6px 14px;
  font-size: 0.85rem;
}
.feed-pools .pool-chip.active { background: var(--ink); }
.stage-page .feed .feed-sound { top: 76px; bottom: auto; right: 12px; }
.feed-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px 16px calc(8px + min(env(safe-area-inset-bottom), 18px));
  text-align: left;
  background: linear-gradient(transparent, rgba(251, 250, 247, 0.85) 72%);
}
.feed-name { font-size: 1.45rem; line-height: 1.15; margin: 0 0 2px; letter-spacing: -0.02em; }
.feed-tagline { font-weight: 600; font-size: 0.95rem; margin: 0 0 8px; }
.feed-example { margin: 0 0 10px; font-size: 0.85rem; cursor: pointer; }
#feed-example-text { font-weight: 600; }
.feed-example-pos { color: var(--muted); font-size: 0.75rem; }
.feed-actions { display: flex; gap: 14px; align-items: center; }
.feed-actions .copy-btn, .feed-actions .big-btn { padding: 9px 18px; }
.feed-subrow {
  display: flex; gap: 16px; align-items: center; margin-top: 8px;
}
.feed-linkbtn {
  background: none; border: none; color: var(--teal-dark); font-weight: 600;
  cursor: pointer; padding: 0; font-size: 0.92rem; font-family: inherit;
  text-decoration: underline;
}
/* A7: Hide text pill floats just above the bottom panel; the Show text
   pill is its mirror at the bottom center while the text is dismissed. */
.feed-hide {
  position: absolute; top: -34px; right: 12px;
  background: rgba(31, 41, 55, 0.82); color: #fff; border: none;
  border-radius: 999px; font-size: 0.78rem; padding: 6px 12px;
  cursor: pointer; font-family: inherit;
}
.feed-show {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 4;
  background: rgba(31, 41, 55, 0.82); color: #fff; border: none;
  border-radius: 999px; font-size: 0.78rem; padding: 6px 12px;
  cursor: pointer; font-family: inherit;
}
/* A7: fill-in one-shot form, inside the feed bottom panel. */
.feed-form {
  background: rgba(251, 250, 247, 0.97); border-radius: 16px;
  padding: 14px; max-height: 74dvh; overflow-y: auto; text-align: left;
}
.feed-form-title { font-weight: 800; margin: 0 0 10px; }
.feed-form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.feed-form textarea {
  width: 100%; box-sizing: border-box; margin-top: 4px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px;
  font: inherit; font-weight: 400;
}
.feed-form-actions { display: flex; gap: 14px; align-items: center; }
.feed-form .copy-note { margin: 8px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--accent); }

[hidden] { display: none !important; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(28, 36, 48, 0.10); }
.card.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.35); }
.card h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.01em; }
.card .hook { margin: 0; font-weight: 600; }
.card .teaser { margin: 0; color: var(--muted); font-style: italic; font-size: 0.95rem; }
.card-actions { margin-top: auto; padding-top: 10px; display: flex; gap: 14px; align-items: center; }
.card-link { font-weight: 600; text-decoration: none; }

.tags { margin: 0; }
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; background: var(--soft); color: var(--muted);
  border-radius: 999px; padding: 3px 10px;
}
.tag-cat { background: var(--accent); color: #fff; }

.copy-btn {
  background: var(--ink); color: #fff; border: 0; cursor: pointer;
  font-weight: 700; font-size: 0.92rem; padding: 10px 18px; border-radius: 999px;
}
.copy-btn:hover { background: var(--accent); }
.copy-btn:disabled { opacity: 0.75; cursor: default; }

.block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 22px 0;
}
.block h2 { margin-top: 0; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.block-head h2 { margin: 0; }
.hint { color: var(--muted); margin: 6px 0 12px; }
.gate { border-left: 5px solid var(--accent); }

pre.code, pre.sample {
  background: #141a21; color: #eef2f5; border-radius: 10px;
  padding: 16px; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem; line-height: 1.5; margin: 0;
}
pre.sample { background: var(--soft); color: var(--ink); }

.bot-page { max-width: 820px; }
.bot-page h1 { font-size: 2.1rem; margin: 6px 0 8px; letter-spacing: -0.02em; }
.what { font-size: 1.12rem; }
.crumb a { text-decoration: none; font-weight: 600; }

.signup form, .submit-form { display: flex; flex-direction: column; gap: 12px; }
.signup form { flex-direction: row; flex-wrap: wrap; align-items: center; }
.signup input[type="email"] {
  flex: 1 1 240px; padding: 12px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px;
}
.form-msg { color: var(--accent); font-weight: 600; margin: 4px 0 0; flex-basis: 100%; }
.submit-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.submit-form input, .submit-form textarea, .submit-form select {
  padding: 11px 12px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.submit-form .big-btn { align-self: flex-start; }

.noresults { text-align: center; color: var(--muted); padding: 26px 0; }

.site-foot {
  border-top: 1px solid var(--line); margin-top: 12px;
  padding: 22px; text-align: center; color: var(--muted); font-size: 0.92rem;
}
.site-foot p { max-width: 720px; margin: 0 auto; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .grid { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .chips { justify-content: center; }
  .site-head { padding: 14px 16px; }
  main { padding: 0 14px 32px; }
  .block { padding: 16px; }
  .bot-page h1 { font-size: 1.7rem; }
  .stage { padding: 22px 16px; }
  .stage-name { font-size: 1.75rem; }
  .stage-pitch { font-size: 1.08rem; }
  pre.code, pre.sample { font-size: 0.82rem; padding: 13px; }
}
