/* WondrBot's site (#101): the app's palette (src/theme/tokens.ts) and fonts,
   self-hosted. One stylesheet, served under a content hash. Links and buttons
   use darker steps of the accent than the app's, so small text passes AA. */

@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url(fonts/Figtree-Regular.4e2e9876c4.ttf) format('truetype'); }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url(fonts/Figtree-SemiBold.1b76aae525.ttf) format('truetype'); }
@font-face { font-family: 'Caprasimo'; font-weight: 400; font-display: swap; src: url(fonts/Caprasimo-Regular.54565d93f2.ttf) format('truetype'); }

:root {
  color-scheme: light dark;
  --bg: #f5ead8;
  --surface: #ebddc5;
  --surface-2: #f9f4ed;
  --ink: #201e1d;
  --muted: #5c5751;
  --line: rgba(32, 30, 29, 0.16);
  --accent: #c67139;
  --accent-soft: #ffc6a5;
  --accent2: #7a8a5e;
  --accent2-soft: #ccdbb2;
  --link: #8c491a;
  --btn: #9a4f1c;
  --btn-ink: #f5ead8;
  --focus: #3b5bdb;
  --frame: #201e1d;
  --screen: #f5ead8;
}

/* Dark when the system is dark and nothing else was chosen, or whenever dark was chosen ("make this page a lot darker"). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #201e1d;
    --surface: #2e2b25;
    --surface-2: #262420;
    --ink: #f5ead8;
    --muted: #b9b1a4;
    --line: rgba(245, 234, 216, 0.16);
    --accent: #d67f48;
    --accent-soft: #643312;
    --accent2: #8fa073;
    --accent2-soft: #3d472b;
    --link: #f6a06b;
    --btn: #e8925a;
    --btn-ink: #201e1d;
    --focus: #9db4ff;
    --frame: #57514a;
    --screen: #161514;
  }
}
:root[data-theme='dark'] {
  --bg: #201e1d;
  --surface: #2e2b25;
  --surface-2: #262420;
  --ink: #f5ead8;
  --muted: #b9b1a4;
  --line: rgba(245, 234, 216, 0.16);
  --accent: #d67f48;
  --accent-soft: #643312;
  --accent2: #8fa073;
  --accent2-soft: #3d472b;
  --link: #f6a06b;
  --btn: #e8925a;
  --btn-ink: #201e1d;
  --focus: #9db4ff;
  --frame: #57514a;
  --screen: #161514;
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2 { font-family: Caprasimo, Georgia, serif; font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); margin-top: 0; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; margin: 0 0 0.35em; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40em; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 2; }
/* read by assistive technology, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* the home heading's morph: every line in one cell, so the heading keeps the height of its tallest line */
.morph { display: grid; }
.morph > span { grid-area: 1 / 1; opacity: 0; filter: blur(6px); transform: translateY(0.12em); transition: opacity 0.45s ease, filter 0.45s ease, transform 0.45s ease; }
.morph > span.on { opacity: 1; filter: none; transform: none; }
/* the heading and its pause button, side by side */
.morph-row { display: flex; align-items: flex-start; gap: 12px; }
.morph-row h1 { flex: 1; min-width: 0; }
.morph-toggle { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 0.35em; padding: 0; border-radius: 999px; border: 2px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.morph-toggle:hover { color: var(--ink); border-color: var(--muted); }
.morph-toggle svg { width: 12px; height: 12px; fill: currentColor; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* header and footer */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: Caprasimo, Georgia, serif; font-size: 1.7rem; color: var(--accent); text-decoration: none; line-height: 1; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-left: auto; }
@media (max-width: 639px) {
  .top .app { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; }
}
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a[aria-current='page'] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 36px 0 48px; color: var(--muted); font-size: 0.95rem; }
.foot .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.foot h2 { font-family: Figtree, system-ui, sans-serif; font-weight: 600; font-size: 0.95rem; color: var(--ink); margin: 0 0 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 4px 0; }
.foot a { color: var(--muted); }
.foot .fine { margin-top: 28px; }

/* buttons */
.btn { display: inline-block; background: var(--btn); color: var(--btn-ink); text-decoration: none; font-weight: 600; padding: 12px 22px; border-radius: 999px; border: 2px solid var(--btn); line-height: 1.2; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 7px 16px; font-size: 0.95rem; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 24px 0 8px; }
.no-card { color: var(--muted); font-size: 0.95rem; }
.note { font-size: 0.95rem; color: var(--muted); }

/* sections */
main { display: block; }
main h1 { margin-top: 44px; }
main .hero h1 { margin-top: 0; }
.section { padding: 56px 0 0; }
.narrow > .section { padding-top: 32px; }
.hero { display: grid; gap: 32px; align-items: center; padding-top: 48px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.05fr 0.95fr; padding-top: 72px; } }
.hero-art { aspect-ratio: 600 / 480; width: 100%; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cards.wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards.wide .art { max-width: 220px; }
.card { background: var(--surface); border-radius: 28px; padding: 22px; }
.card .art { display: block; width: 100%; aspect-ratio: 160 / 110; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }
/* ecosystem: a tile with the project's initials beside its name */
.cards.projects { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.project { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.project h2, .project h3 { margin: 2px 0 6px; }
.project h2 a, .project h3 a { color: inherit; text-decoration: none; }
.project h2 a::after, .project h3 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.project:hover h2 a, .project:hover h3 a, .project h2 a:focus-visible, .project h3 a:focus-visible { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.project:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.project .host { color: var(--muted); font-size: 0.9rem; }
.tile { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; font-family: Caprasimo, Georgia, serif; font-size: 1.35rem; color: var(--ink); }
.tile.t0 { background: var(--accent-soft); }
.tile.t1 { background: var(--accent2-soft); }
.tile.t2 { background: var(--line); }
.project.featured { margin-bottom: 20px; padding: 28px; }
.project.featured .tile { width: 72px; height: 72px; font-size: 1.7rem; border-radius: 22px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; border-top: 2px solid var(--accent); padding-top: 12px; }
.steps li::before { content: counter(step); font-family: Caprasimo, Georgia, serif; font-size: 1.6rem; color: var(--accent); display: block; }
.principles { display: grid; gap: 28px 40px; }
@media (min-width: 760px) { .principles { grid-template-columns: 1fr 1fr; } }
.principles section { border-left: 3px solid var(--accent2); padding-left: 16px; }
.band { background: var(--surface); border-radius: 32px; padding: 32px 24px; margin-top: 56px; }
.band h2 { margin-bottom: 0.4em; }

/* about: facts and questions */
dl.facts { display: grid; grid-template-columns: minmax(120px, 13em) 1fr; margin: 0; border-top: 1px solid var(--line); }
dl.facts dt, dl.facts dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
dl.facts dt { font-weight: 600; padding-right: 16px; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; } dl.facts dt { border-bottom: 0; padding-bottom: 0; } }
.faq section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq p { margin-bottom: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 6px 0; }

/* pricing */
.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 28px; }
.plan { background: var(--surface); border-radius: 28px; padding: 24px 22px; display: flex; flex-direction: column; gap: 6px; }
.plan h2 { font-size: 1.6rem; margin: 0; }
.plan .price { font-family: Caprasimo, Georgia, serif; font-size: 2.2rem; line-height: 1.1; margin: 4px 0; }
.plan .price small { font-family: Figtree, system-ui, sans-serif; font-size: 1rem; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 8px 0 0; }
.plan li { padding: 7px 0; border-top: 1px solid var(--line); }
.rates { border-collapse: collapse; margin: 8px 0 16px; }
.rates caption { caption-side: top; text-align: left; padding-bottom: 6px; }
.rates th, .rates td { text-align: left; padding: 6px 18px 6px 0; border-bottom: 1px solid var(--line); }
.pill { display: inline-block; font-size: 0.85rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent2-soft); color: var(--ink); }

/* illustration fills: presentation attributes are the fallback, these follow the scheme */
.f-bg { fill: var(--bg); }
.f-surface { fill: var(--surface); }
.f-surface2 { fill: var(--surface-2); }
.f-ink { fill: var(--ink); }
.f-muted { fill: var(--muted); }
.f-accent { fill: var(--accent); }
.f-btn { fill: var(--btn); }
.f-accent-soft { fill: var(--accent-soft); }
.f-accent2 { fill: var(--accent2); }
.f-accent2-soft { fill: var(--accent2-soft); }
.f-frame { fill: var(--frame); }
.f-screen { fill: var(--screen); }
.f-btn-ink { fill: var(--btn-ink); }
.s-ink { stroke: var(--ink); }
.s-accent { stroke: var(--accent); }
.s-accent2 { stroke: var(--accent2); }
.s-muted { stroke: var(--muted); }
.s-line { stroke: var(--line); }

/* the hero builds itself, once; no motion for anyone who asked for less */
@media (prefers-reduced-motion: no-preference) {
  .build { animation: build 0.6s ease-out both; }
  .build.b1 { animation-delay: 0.5s; }
  .build.b2 { animation-delay: 0.9s; }
  .build.b3 { animation-delay: 1.3s; }
  .build.b4 { animation-delay: 1.7s; }
  .build.b0 { animation-delay: 0.1s; }
}
@keyframes build { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── the restyle frame (home), and the styles its prompts put on this site ── */
.restyle p { max-width: 60ch; }
.prompts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.prompt { font: inherit; font-size: 0.95rem; text-align: left; padding: 10px 16px; border-radius: 18px 18px 18px 6px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.prompt:hover:not(:disabled) { border-color: var(--accent); }
.prompt[aria-pressed='true'] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.prompt:disabled { cursor: default; opacity: 0.85; }
.prompt.reset { border-style: dashed; color: var(--muted); }
.reply { min-height: 1.6em; color: var(--muted); font-size: 0.95rem; margin: 0; }

html.s-blue {
  --accent: #3f6fc4; --accent-soft: #c8d8f5; --link: #2451a3; --btn: #244f9e; --btn-ink: #f5ead8;
}
@media (prefers-color-scheme: dark) {
  html.s-blue:not([data-theme='light']) { --accent: #6f9ae6; --accent-soft: #1f3766; --link: #9dbcf4; --btn: #86a9ee; --btn-ink: #201e1d; }
}
html.s-blue[data-theme='dark'] { --accent: #6f9ae6; --accent-soft: #1f3766; --link: #9dbcf4; --btn: #86a9ee; --btn-ink: #201e1d; }
html.s-arial h1, html.s-arial h2, html.s-arial h3, html.s-arial .plan .price, html.s-arial .steps li::before { font-family: Arial, Helvetica, sans-serif; font-weight: 700; letter-spacing: 0; }
html.s-large body { font-size: 20px; }
html.s-square *, html.s-square *::before, html.s-square *::after { border-radius: 2px !important; }
@media (prefers-reduced-motion: no-preference) {
  html.restyling *, html.restyling *::before, html.restyling *::after { transition: color 0.35s, background-color 0.35s, border-color 0.35s, fill 0.35s, stroke 0.35s, border-radius 0.35s; }
}

/* "Try it now" under the first step: a prompt that fixes the page light or dark */
.try-now { margin-top: 10px; font-size: 0.95rem; }
.try-now .prompt { margin-top: 6px; }

