:root {
  --ink: #111111;
  --paper: #ffffff;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --accent: #d97757;          /* used ONLY for the active agent / result moment */
  --maxw: 1180px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }

/* ---------- single-screen stage ---------- */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 22px clamp(20px, 5vw, 56px) 16px;
  position: relative;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 20px;
}

.ghost-link {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  transition: border-color .2s, color .2s;
}
.ghost-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.hero-copy h1 {
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin: 0 0 22px;
}

.ink-underline {
  position: relative;
  white-space: nowrap;
}
.ink-underline::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.06em;
  height: 0.42em;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cpath d='M3 20 C 60 8, 110 26, 160 16 S 250 6, 297 18' fill='none' stroke='%23d97757' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
  background-size: 100% 100%;
  z-index: -1;
  opacity: .9;
}

.sub {
  font-size: clamp(16px, 1.6vw, 20px);
  color: #333;
  max-width: 30ch;
  margin: 0 0 18px;
}

.micro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 28px;
}
.micro-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink);
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 12px;
  transition: transform .12s ease, background .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* ---------- the interactive stage ---------- */
.hero-stage { display: flex; flex-direction: column; align-items: stretch; }

/* feature tab strip */
.tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.tab {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* the user's question — typed (human) above the hand-drawn team (AI) */
.ask {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-height: 28px;
  margin: 70px 0 6px;
  opacity: 0;
  transition: opacity .25s ease;
}
.ask.show { opacity: 1; }
.ask-text {
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
}
.ask-text::before { content: "“"; }
.ask-text::after { content: "”"; }
.ask.typing .ask-text::after {
  content: "▌";
  color: var(--accent);
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.scene-wrap { position: relative; width: 100%; }

#scene {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* CSS controls colour (inline strokes are stripped in JS so the accent can swap) */
#scene path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#scene .agent.active path { stroke: var(--accent); }

/* when the result lands, the scene recedes so the answer pops */
#scene .agent, #scene .arrow, #scene .wf-box, #scene .conv-bubble,
#scene .sch-clock, #scene .sch-hand, #scene .sch-out,
#scene .conn-card, #scene .conn-link, #scene .tele-phone { transition: opacity .45s ease; }
#scene.resolved .agent, #scene.resolved .arrow, #scene.resolved .wf-box, #scene.resolved .conv-bubble,
#scene.resolved .sch-clock, #scene.resolved .sch-hand, #scene.resolved .sch-out,
#scene.resolved .conn-card, #scene.resolved .conn-link, #scene.resolved .tele-phone { opacity: 0.16; }

/* Conversations: speech bubbles; the challenge bubble carries the accent */
#scene .conv-bubble.challenge .bub path { stroke: var(--accent); }
#scene .conv-bubble.challenge .conv-text { fill: var(--accent); }

/* Schedules: an animated clock; agents wake at their hour and produce work */
#scene .sch-hand path { stroke: var(--accent); }   /* the moving hour hand draws the eye */
.sch-agent { transition: opacity .45s ease; }
.sch-agent.asleep { opacity: 0.28; }
.sch-agent.awake .sch-z { opacity: 0; }
#scene .sch-out path { stroke: var(--accent); }     /* produced work = the highlight */

/* Connections: agents wire out to your tools, or you reach them from Telegram */
#scene .conn-link.live path { stroke: var(--accent); }  /* a live connection turns accent */
.conn-card .conn-label { font-size: 19px; }

/* Workflow: hand-drawn task boxes */
#scene .wf-box.active .box path { stroke: var(--accent); }
.wf-box .wf-label { font-size: 15px; }
#scene .wf-box.active .wf-label { fill: var(--accent); }

/* all in-scene labels are handwritten, to match the doodles */
#scene .label {
  font-family: var(--hand);
  font-weight: 700;
  fill: var(--ink);
}
.agent .label { font-size: 21px; }
#scene .agent.active .label { fill: var(--accent); }
#scene .arrow.active path { stroke: var(--accent); }

.result-card {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%) translateY(8px);
  width: min(300px, 70%);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 4px 5px 0 rgba(17,17,17,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
.result-card.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.result-title {
  font-weight: 700; font-size: 14px; margin-bottom: 8px;
  color: var(--accent);
  display: flex; align-items: center; gap: 6px;
}
.result-title::before { content: "✓"; }
.result-list { margin: 0; padding-left: 18px; text-align: left; }
.result-list li { font-size: 14px; color: #222; margin: 3px 0; }

.prompt-label {
  text-align: center;
  font-family: var(--hand);
  font-size: 19px;
  color: #555;
  margin: 8px 0 12px;
}

.cards, .controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 36px;
}
/* secondary "try it" chips — deliberately lighter than the Download / Star CTAs */
.card {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.card:hover { color: var(--ink); border-color: var(--ink); }
.card.selected { color: var(--ink); border-color: var(--ink); background: #fafafa; }

.scroll-hint {
  text-align: center;
  font-size: 26px;
  color: var(--muted);
  text-decoration: none;
  margin-top: 8px;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(5px);} }

/* ---------- tail ---------- */
.tail {
  border-top: 1px solid var(--line);
  padding: clamp(56px, 9vw, 110px) clamp(20px, 5vw, 56px);
}
.tail-inner { max-width: 880px; margin: 0 auto; }

/* ---------- screenshot carousel ---------- */
.shots-lead {
  max-width: 660px;
  margin: 0 auto 40px;
  text-align: center;
}
.shots-lead h2 {
  font-size: clamp(26px, 3.6vw, 38px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.shots-lead p {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.7;
  color: #444;
  margin: 0;
}
.shots-lead .ink-underline { color: var(--ink); font-weight: 600; }
/* sit the squiggle just below the text so it doesn't cross the letters */
.shots-lead .ink-underline::after { bottom: -0.12em; height: 0.26em; opacity: 0.85; }
.keep-box {
  border: 1px solid #d6d6d6;
  background: #fafafa;
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
  color: var(--ink);
}
.shots { max-width: 880px; margin: 0 auto; }

/* the screenshots already include their own window — just frame them */
.shot-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.16);
}
.shot-img {
  width: 100%; aspect-ratio: 1.46 / 1; object-fit: cover;
  display: block; transition: opacity .3s ease;
}

/* caption sits ON the image, over a legibility scrim */
.shot-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 64px 30px 22px;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.84) 0%, rgba(10, 10, 12, 0.5) 45%, transparent 100%);
  text-align: left;
  pointer-events: none;
}
.shots-title {
  color: #fff; font-size: clamp(19px, 2.4vw, 25px);
  letter-spacing: -0.02em; margin: 0 0 4px;
}
.shots-text { color: rgba(255, 255, 255, 0.86); margin: 0; max-width: 54ch; font-size: 15px; }

.theme-toggle {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  font: inherit; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.1); background: rgba(255, 255, 255, 0.92); color: #111;
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.shot-play {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  font: inherit; font-size: 12px; line-height: 1;
  border: 1px solid rgba(0, 0, 0, 0.1); background: rgba(255, 255, 255, 0.92); color: #111;
  border-radius: 999px; width: 30px; height: 30px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

.shot-nav {
  position: absolute; top: 44%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1); background: rgba(255, 255, 255, 0.92); color: #111;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.shots:hover .shot-nav { opacity: 1; }
.shot-nav.prev { left: 12px; } .shot-nav.next { right: 12px; }

.shot-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.shot-dots button {
  width: 8px; height: 8px; border-radius: 50%; border: none;
  background: var(--line); cursor: pointer; padding: 0; transition: background .2s;
}
.shot-dots button.active { background: var(--accent); }

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.foot a { text-decoration: none; }

/* ---------- responsive / mobile ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
    padding-top: 8px;
  }
  .hero-copy { order: 1; }
  .hero-stage { order: 2; }
  .sub, .hero-copy h1 { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .micro-badge { justify-content: center; }
  /* mobile primary CTA = Star (can't install a desktop app on a phone) */
  body.is-mobile #cta-star { background: var(--ink); color: var(--paper); border-color: var(--ink); order: -1; }
  body.is-mobile #cta-download { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
  * { scroll-behavior: auto; }
}
