/* Prompt Paws browser demo.
   Shapes: windows, panels and pictures use 12px corners; buttons and segmented controls are pills.
   Layers on the stage: windows 1-9999 (raised by focus), panda 10000, its click area 10001,
   play button 10002, loading and fallback 10003. */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #15171c;
  --muted: #545a66;
  --line: #dcdfe5;
  --accent: #f4b82a;          /* the panda's hoodie */
  --accent-ink: #15171c;
  --needs: #ff9f0a;           /* the app's bubble colours */
  --ready: #30d158;
  --shadow: 0 1px 2px rgba(21, 27, 38, .06), 0 8px 24px rgba(21, 27, 38, .08);
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #181b21;
    --ink: #eceef2;
    --muted: #a5abb6;
    --line: #2b2f37;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.ic { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

/* ---- buttons ---- */

.btn {
  display: inline-flex; align-items: center; gap: .5em;
  height: 46px; padding: 0 20px; border-radius: 999px;
  font: 600 15px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible, .seg button:focus-visible, .nav a:focus-visible, .pet-hit:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ffc53d; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }

/* ---- top bar ---- */

.nav {
  max-width: 1320px; height: 64px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; text-decoration: none; }
.brand .ic { color: var(--accent); width: 22px; height: 22px; }
.nav nav { display: flex; gap: 24px; }
.nav nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 15px; }
.nav nav a:hover { color: var(--ink); }

/* ---- hero: copy on the left, the live demo on the right ---- */

.hero {
  max-width: 1320px; margin: 0 auto; padding: clamp(16px, 4vh, 48px) 24px 72px;
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; align-items: start;
}
/* Top-aligned, so the stage stays put when the controls under it appear. */
.hero-copy { display: grid; gap: 22px; align-content: center; margin-top: clamp(0px, 5vw, 64px); }
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 2.2vw, 3.1rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 750; }
.lede { color: var(--muted); font-size: 18px; max-width: 34ch; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.demo { display: grid; gap: 14px; min-width: 0; }

/* ---- the stage: a pretend Mac desktop, drawn at a fixed size and scaled ---- */

.stage-wrap {
  position: relative; width: 100%; overflow: hidden; border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(21, 27, 38, .08), 0 24px 60px rgba(21, 27, 38, .22);
  background: #4a5262;
}
.stage {
  position: absolute; left: 0; top: 0; width: 760px; height: 475px; transform-origin: 0 0;
  overflow: hidden; user-select: none; -webkit-user-select: none;
  font-family: var(--sans);
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(255, 214, 120, .22), transparent 55%),
    radial-gradient(90% 80% at 10% 100%, rgba(120, 150, 210, .35), transparent 60%),
    linear-gradient(160deg, #7c879a 0%, #586174 50%, #3c4351 100%);
}
.stage.narrow { width: 400px; height: 560px; }

.menubar {
  position: absolute; left: 0; right: 0; top: 0; height: 26px; z-index: 9999;
  display: flex; align-items: center; gap: 16px; padding: 0 14px;
  font-size: 12.5px; color: #fff; background: rgba(24, 27, 34, .38);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.menubar .app-name { font-weight: 700; }
.menubar .spacer { flex: 1; }
.status-icon { display: inline-flex; color: #fff; }
.status-icon .ic { width: 16px; height: 16px; }
.status-icon.needs { color: var(--needs); }
.status-icon.ready { color: var(--ready); }
.stage.narrow .hide-narrow { display: none; }

.win {
  position: absolute; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 44px rgba(12, 16, 24, .38), 0 2px 6px rgba(12, 16, 24, .25);
}
.titlebar {
  height: 30px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  font-size: 12px; position: relative;
}
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.titlebar .title { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; font-weight: 600; }

.term { left: 26px; top: 48px; width: 500px; height: 330px; background: #17191e; color: #d9dde4; }
.term .titlebar { background: #24272e; color: #aab0bb; }
.browser { left: 290px; top: 104px; width: 446px; height: 300px; background: #fff; color: #1f2328; }
.browser .titlebar { background: #eceef1; }
.browser .url {
  flex: 1; height: 20px; display: flex; align-items: center; padding: 0 10px; border-radius: 999px;
  background: #fff; color: #59636e; font-size: 11.5px; overflow: hidden; white-space: nowrap;
}
.stage.narrow .term { left: 10px; top: 36px; width: 380px; height: 300px; }
.stage.narrow .browser { left: 22px; top: 214px; width: 356px; height: 232px; }

.tabs { display: flex; flex: none; background: #1d2026; border-bottom: 1px solid #2c3038; }
.tabs button {
  flex: 1; height: 26px; border: 0; background: transparent; color: #8d94a0; cursor: pointer;
  font: 600 11.5px var(--sans);
}
.tabs button.on { background: #17191e; color: #e8ebf0; }

.screen {
  flex: 1; overflow-y: auto; padding: 10px 14px 14px; scrollbar-width: none;
  font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word;
}
.screen::-webkit-scrollbar { display: none; }
.ln { min-height: 1.6em; }
.ln.prompt { margin: 6px 0; padding: 3px 8px; border-radius: 6px; background: #262a32; color: #fff; }
.ln .dot { color: #e8ebf0; }
.ln .dot.ok { color: #3ccf6e; }
.ln.out { color: #8f97a3; }
.ln.shell { color: #c9ced6; }
.ln.spin { color: var(--accent); margin-top: 4px; }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -0.2em; background: #d9dde4; }
@media (prefers-reduced-motion: no-preference) {
  .caret { animation: caret 1.1s steps(1) infinite; }
  .ln.spin { animation: breathe 1.6s ease-in-out infinite; }
}
@keyframes caret { 50% { opacity: 0; } }
@keyframes breathe { 50% { opacity: .45; } }

.ask { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--needs); border-radius: 8px; white-space: normal; }
.ask-title { color: var(--needs); font-weight: 700; }
.ask-file { color: #c9ced6; }
.ask-diff { margin: 6px 0; padding: 6px 8px; border-radius: 6px; background: #1f2228; white-space: pre-wrap; }
.ask-diff .add { color: #7ee2a0; }
.ask-diff .del { color: #ff9b95; }
.ask-q { margin: 6px 0 4px; }
.opt {
  display: block; width: 100%; text-align: left; margin-top: 3px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: #d9dde4; cursor: pointer; font: inherit;
}
.opt:hover, .opt:focus-visible { background: #2a2e36; outline: none; }
.opt.first { border-color: rgba(255, 159, 10, .55); color: #fff; }

.page { padding: 16px 20px; font-size: 13px; line-height: 1.5; overflow: hidden; }
.page h3 { font-size: 17px; letter-spacing: -0.01em; }
.page .meta { margin: 4px 0 12px; color: #1a7f37; font-weight: 600; font-size: 12px; }
.page p + p { margin-top: 10px; }
.page .files { font-family: var(--mono); font-size: 12px; color: #59636e; }

.pet {
  position: absolute; left: 0; top: 0; width: 200px; height: 200px; border: 0; z-index: 10000;
  background: transparent; pointer-events: none; color-scheme: normal;
}
.pet-hit {
  position: absolute; left: 0; top: 0; z-index: 10001; padding: 0; border: 0; border-radius: 40%;
  background: transparent; cursor: grab; touch-action: none;
}
.pet-hit:active { cursor: grabbing; }
.pet-hit.hint::after {
  content: ""; position: absolute; inset: -8px; border-radius: 45%;
  border: 2px solid var(--needs); opacity: .9;
}
@media (prefers-reduced-motion: no-preference) {
  .pet-hit.hint::after { animation: ring 1.6s ease-out infinite; }
}
@keyframes ring { from { transform: scale(.92); opacity: .95; } to { transform: scale(1.12); opacity: 0; } }

.overlay { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 10002; }
.overlay .btn { height: 52px; padding: 0 26px; font-size: 16px; box-shadow: 0 10px 30px rgba(12, 16, 24, .35); }

.loading, .fallback {
  position: absolute; inset: 0; z-index: 10003; display: grid; place-items: center; text-align: center;
}
.loading span {
  padding: 8px 16px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(24, 27, 34, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
@media (prefers-reduced-motion: no-preference) {
  .loading span { animation: breathe 1.6s ease-in-out infinite; }
}
.fallback { background: #3c4351; color: #fff; padding: 24px; gap: 12px; align-content: center; }
.fallback img { width: 46%; max-width: 260px; height: auto; border-radius: var(--radius); }
.fallback p { max-width: 40ch; font-size: 15px; }

@media (prefers-reduced-transparency: reduce) {
  .menubar, .loading span { background: #2a2f39; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---- under the stage: story captions or the free play controls ---- */

.dock { min-height: 112px; }
.dock-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dock-row p { color: var(--muted); font-size: 15px; }
#caption { color: var(--ink); font-weight: 600; font-size: 16px; }
#dock-free { display: grid; gap: 12px; }
#dock-free .dock-row p { color: var(--ink); }
.controls { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.controls .label { font: 600 13px var(--mono); color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); justify-self: start; }
.seg button {
  height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button[data-state="needs"][aria-pressed="true"] { background: var(--needs); color: #15171c; }
.seg button[data-state="ready"][aria-pressed="true"] { background: var(--ready); color: #15171c; }
.tip { color: var(--muted); font-size: 14px; }

/* ---- sections below the hero ---- */

section.how, section.made, section.stats { max-width: 1320px; margin: 0 auto; padding: 88px 24px; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1.1; letter-spacing: -0.025em; }
.intro { margin-top: 10px; color: var(--muted); font-size: 18px; max-width: 60ch; }

.flow {
  list-style: none; margin: 40px 0 0; padding: 0; counter-reset: flow;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border-top: 1px solid var(--line);
}
.flow li { position: relative; padding: 28px 28px 0 0; counter-increment: flow; }
.flow li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.flow li::before {
  content: counter(flow); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 16px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.flow h3 { font-size: 18px; margin-bottom: 8px; }
.flow p { color: var(--muted); font-size: 15.5px; }
.note {
  margin-top: 40px; padding: 18px 22px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); max-width: 78ch; font-size: 15.5px;
}

.made { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.pics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.pics figure { margin: 0; }
.pics img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.pics img { aspect-ratio: 3 / 4; object-fit: cover; }
.pics figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; }
.steps { margin: 32px 0 0; display: grid; gap: 0; }
.steps > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps dt { font-weight: 700; }
.steps dd { margin: 0; color: var(--muted); font-size: 15px; grid-column: 1; }
.steps dd.cost { grid-column: 2; grid-row: 1; color: var(--ink); font: 600 14px var(--mono); }

.stats dl { margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.stats dl > div { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stats dt { font: 750 44px/1 var(--sans); letter-spacing: -0.03em; }
.stats dl > div:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stats dl > div:first-child dd { color: var(--accent-ink); }
.stats dd { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.foot { max-width: 1320px; margin: 0 auto; padding: 40px 24px 56px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.foot-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.fine { color: var(--muted); font-size: 13.5px; }

/* ---- smaller screens ---- */

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 16px; }
  .hero-copy { margin-top: 0; }
  .lede { max-width: 46ch; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:nth-child(3) { padding-left: 0; border-left: 0; }
  .made { grid-template-columns: 1fr; gap: 36px; }
  .stats dl { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav, .hero, section.how, section.made, section.stats, .foot { padding-left: 16px; padding-right: 16px; }
  .nav nav .hide-sm { display: none; }
  .hero { padding-bottom: 48px; }
  .lede { font-size: 17px; }
  .dock-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .controls { grid-template-columns: 1fr; gap: 6px; }
  .controls .label { margin-top: 6px; }
  section.how, section.made, section.stats { padding-top: 56px; padding-bottom: 56px; }
  .flow { grid-template-columns: 1fr; }
  .flow li, .flow li + li { padding: 24px 0 0; border-left: 0; }
  .stats dt { font-size: 36px; }
}
