:root {
  --ink:       #33415c;   /* the outline colour used all over the drawing */
  --ink-soft:  #5b6b87;
  --paper:     #fffdf8;
  --teal:      #3ba88f;
  --teal-dark: #2b7d6a;
  --sun:       #ffd166;
  --coral:     #ef8354;
  --sky:       #c6e9fa;
  --radius:    20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sky);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
}

/* ---------- the drawing ---------- */

/* Fixed behind everything, anchored to the bottom so the plane sits on the
   ground no matter how tall the page gets. */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.cloud-a { animation: drift 46s linear infinite; }
.cloud-b { animation: drift 62s linear infinite; }
.cloud-c { animation: drift 54s linear infinite reverse; }
.plane   { animation: hover 6s ease-in-out infinite; }
.sun     { animation: breathe 9s ease-in-out infinite; }
.wave    { animation: waving 1.4s ease-in-out infinite; transform-origin: 762px 762px; }

.traveller   { animation: bob 3.4s ease-in-out infinite; }
.traveller-b { animation-delay: -0.7s; }
.traveller-c { animation-delay: -1.5s; }
.traveller-d { animation-delay: -2.2s; }

@keyframes drift   { from { transform: translateX(-180px); } to { transform: translateX(1560px); } }
@keyframes hover   { 50% { transform: translateY(-9px); } }
@keyframes bob     { 50% { transform: translateY(-5px); } }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes waving  { 50% { transform: rotate(-22deg); } }

@media (prefers-reduced-motion: reduce) {
  .cloud-a, .cloud-b, .cloud-c, .plane, .sun, .wave, .traveller {
    animation: none;
  }
}

/* ---------- header ---------- */

.topbar {
  max-width: 940px;
  margin: 0 auto;
  padding: 26px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo  { width: 42px; height: 42px; display: block; }

.brand h1 {
  margin: 0;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  /* A chunky offset shadow, the way the drawing is outlined. */
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(51, 65, 92, 0.18);
}

.sub {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 3px 14px;
  box-shadow: 3px 3px 0 rgba(51, 65, 92, 0.25);
}

/* ---------- cards ---------- */

main {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px 340px;   /* room at the bottom so the plane stays visible */
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ask, .agent, .plan {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(51, 65, 92, 0.22);
}

.ask  { padding: 20px 22px; }
.agent, .plan { padding: 18px 20px; }

.ask label {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

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

input[type="text"] {
  flex: 1;
  min-width: 240px;
  height: 50px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
}

input::placeholder { color: #9aa7ba; }

button {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
  height: 50px;
  padding: 0 26px;
  cursor: pointer;
  color: #fff;
  background: var(--teal);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(51, 65, 92, 0.3);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

button:hover:not(:disabled) { background: var(--teal-dark); }

/* Press the button into the page rather than scaling it — reads as physical. */
button:active:not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 rgba(51, 65, 92, 0.3);
}

button:disabled { opacity: 0.5; cursor: default; }

input:focus-visible, button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.examples button {
  height: auto;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  border-width: 2px;
  border-radius: 999px;
  box-shadow: 3px 3px 0 rgba(51, 65, 92, 0.18);
}

.examples button:hover:not(:disabled) { background: var(--sun); }
.examples button:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }

.status {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  min-height: 21px;
}

.status.error { color: #c94f4f; }

/* ---------- agent cards ---------- */

.crew {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

.agent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.agent-head h2 {
  margin: 0;
  flex: 1;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.state {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* The pip is the only progress indicator: hollow while waiting, pulsing while
   the agent is thinking, filled once it has answered. */
.pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ink);
  flex: none;
}

[data-state="running"] .pip { background: var(--sun); animation: pulse 1.1s ease-in-out infinite; }
[data-state="done"] .pip    { background: var(--teal); }

@keyframes pulse { 50% { transform: scale(0.72); } }

@media (prefers-reduced-motion: reduce) {
  [data-state="running"] .pip { animation: none; }
}

.body { font-size: 14.5px; color: var(--ink-soft); }
.body:empty { display: none; }
.plan .body { font-size: 15.5px; color: var(--ink); }

.body h3 {
  margin: 18px 0 6px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.body h3:first-child { margin-top: 0; }
.body p  { margin: 0 0 10px; }
.body ul { margin: 0 0 10px; padding-left: 20px; }
.body li { margin-bottom: 5px; }
.body li::marker { color: var(--teal); }
.body strong { color: var(--ink); font-weight: 700; }
.body em { color: var(--ink-soft); }

/* ---------- footer ---------- */

.note {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  text-align: center;
  background: rgba(255, 253, 248, 0.85);
  border-radius: 12px;
  padding: 8px 14px;
}

.note a { color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.note a:hover { text-decoration: underline; }

[hidden] { display: none !important; }

/* On a phone the drawing is mostly off-screen, so claw back the padding that
   was reserving room for it. */
@media (max-width: 620px) {
  main { padding-bottom: 200px; }
  .brand h1 { font-size: 25px; }
}
