/* Demo Lab. One stylesheet, many businesses: each sample business sets data-theme, which swaps
   the color tokens, the heading font, and the shape language (corner radius, heading style).
   The page structure stays the same; only the look changes, like a real small-business site. */
:root, [data-theme] {
  color-scheme: light dark;
  --bg: #f7f5ef; --surface: #fff; --ink: #1d2825; --muted: #65716c; --line: #e2e5df;
  --primary: #236d58; --on-primary: #fff; --accent: #f1c66c; --soft: #e5f1d4;
  --display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px; --h-weight: 850; --h-track: -.05em; --h-case: none;
  --shadow: 0 18px 55px rgba(27, 46, 37, .1);
}
@media (prefers-color-scheme: dark) {
  :root, [data-theme] {
    --bg: #151a18; --surface: #202724; --ink: #eff2ed; --muted: #a7b2aa; --line: #38423c;
    --primary: #9fd9bd; --on-primary: #10201a; --accent: #bd9854; --soft: #2b3a2f;
    --shadow: 0 18px 55px rgba(0, 0, 0, .3);
  }
}

/* ---- business themes (light) ---- */
[data-theme="outdoor"] { --bg: #f3efe6; --surface: #fffdf8; --ink: #1f2a22; --muted: #5f6a5f; --line: #ddd6c6;
  --primary: #2f5d3a; --on-primary: #fff; --accent: #c0612f; --soft: #e3e9d6;
  --display: Rockwell, "Roboto Slab", "Bookman Old Style", Georgia, serif; --radius: 6px; --h-weight: 800; --h-track: -.02em; }
[data-theme="studio"] { --bg: #fbf6f3; --surface: #fff; --ink: #2b1d24; --muted: #74636b; --line: #efdfe3;
  --primary: #8a3b5c; --on-primary: #fff; --accent: #e9a97f; --soft: #f6e6ea;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; --radius: 28px; --h-weight: 500; --h-track: -.02em; }
[data-theme="pet"] { --bg: #f2f8f6; --surface: #fff; --ink: #183532; --muted: #5d7471; --line: #d5e8e3;
  --primary: #0f766e; --on-primary: #fff; --accent: #f07a55; --soft: #ddf1ec;
  --display: ui-rounded, "SF Pro Rounded", Nunito, "Segoe UI", system-ui, sans-serif; --radius: 24px; --h-weight: 800; --h-track: -.03em; }
[data-theme="tutor"] { --bg: #fdfbf3; --surface: #fff; --ink: #1b2340; --muted: #5f6787; --line: #e6e3d3;
  --primary: #2740a8; --on-primary: #fff; --accent: #f5c518; --soft: #fff4c2;
  --display: "Avenir Next", Avenir, "Century Gothic", "Trebuchet MS", system-ui, sans-serif; --radius: 12px; --h-weight: 800; --h-track: -.03em; }
[data-theme="home"] { --bg: #f4f5f7; --surface: #fff; --ink: #151c2c; --muted: #5b6474; --line: #dfe3ea;
  --primary: #1d4ed8; --on-primary: #fff; --accent: #ea580c; --soft: #e8efff;
  --display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif; --radius: 4px; --h-weight: 800; --h-track: 0; --h-case: uppercase; }
[data-theme="research"] { --bg: #fafaf7; --surface: #fff; --ink: #141414; --muted: #63635d; --line: #e4e4dc;
  --primary: #141414; --on-primary: #fff; --accent: #c7f04f; --soft: #f0f7d4;
  --display: Georgia, "Times New Roman", serif; --radius: 2px; --h-weight: 400; --h-track: -.03em; }

/* ---- business themes (dark) ---- */
@media (prefers-color-scheme: dark) {
  [data-theme="outdoor"] { --bg: #171a15; --surface: #20251e; --ink: #ece8dc; --muted: #a9ae9f; --line: #363d32; --primary: #8cc79a; --on-primary: #10200f; --accent: #e08a5a; --soft: #2a3427; }
  [data-theme="studio"] { --bg: #1c1418; --surface: #271c21; --ink: #f6e9ee; --muted: #b9a3ad; --line: #3d2c34; --primary: #e59bbb; --on-primary: #2b0f1c; --accent: #e9a97f; --soft: #3a2430; }
  [data-theme="pet"] { --bg: #0f1d1b; --surface: #172826; --ink: #e3f3ef; --muted: #9cb9b3; --line: #2a403c; --primary: #5fd0c3; --on-primary: #06221f; --accent: #fb9a7b; --soft: #1c3531; }
  [data-theme="tutor"] { --bg: #12152a; --surface: #1b2038; --ink: #eef0fb; --muted: #a6acc9; --line: #2e3554; --primary: #9fb1ff; --on-primary: #101633; --accent: #f5c518; --soft: #2e2b18; }
  [data-theme="home"] { --bg: #0f131b; --surface: #171d29; --ink: #e9edf5; --muted: #a4acbb; --line: #2b3242; --primary: #8aa6ff; --on-primary: #0d1530; --accent: #fb923c; --soft: #1f2a4a; }
  [data-theme="research"] { --bg: #121211; --surface: #1b1b19; --ink: #f1f1ea; --muted: #a9a99f; --line: #33332e; --primary: #f1f1ea; --on-primary: #121211; --accent: #b6e03a; --soft: #262d16; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: var(--h-weight); letter-spacing: var(--h-track); text-transform: var(--h-case); }
.eyebrow { margin: 0; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.demo-disclaimer { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

/* ---- Demo Lab index ---- */
.demo-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px max(24px, calc((100% - 1120px) / 2)); border-bottom: 1px solid var(--line); }
.demo-header a:last-child { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.demo-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; text-decoration: none; }
.demo-brand span { padding: 3px 7px; border-radius: 4px; background: var(--soft); color: var(--primary); font-size: 9px; letter-spacing: .12em; }
.demo-index { width: min(1120px, calc(100% - 40px)); margin: 72px auto; }
.demo-index > h1 { max-width: 700px; margin: 12px 0; font-size: clamp(36px, 6vw, 64px); line-height: 1.03; }
.intro { max-width: 700px; color: var(--muted); font-size: 17px; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.scenario-card { display: flex; flex-direction: column; min-height: 230px; padding: 24px; border: 1px solid var(--line); border-top: 6px solid var(--primary); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.scenario-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.scenario-card h2 { margin: 8px 0; font-size: 24px; line-height: 1.15; }
.scenario-card > p:not(.eyebrow) { flex: 1; color: var(--muted); font-size: 14px; }
.scenario-swatch { display: flex; gap: 5px; margin-bottom: 14px; }
.scenario-swatch i { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); }
.scenario-swatch i + i { background: var(--accent); }
.scenario-swatch i + i + i { background: var(--soft); border: 1px solid var(--line); }
.scenario-link { color: var(--primary); font-size: 13px; font-weight: 750; }
.demo-index > .demo-disclaimer { margin-top: 30px; }

/* ---- sample business site ---- */
.demo-ribbon { padding: 7px 16px; background: var(--ink); color: var(--bg); font-size: 12px; text-align: center; }
.demo-ribbon a { color: inherit; font-weight: 700; }
.business-header, .business-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(24px, calc((100% - 1180px) / 2)); }
.business-header { min-height: 72px; background: var(--surface); border-bottom: 1px solid var(--line); }
.business-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: var(--h-weight); font-size: 18px; text-decoration: none; text-transform: var(--h-case); }
.business-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: min(var(--radius), 12px); background: var(--primary); color: var(--on-primary); font-size: 17px; }
.business-header nav { display: flex; align-items: center; gap: 24px; }
.business-header nav a { color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.business-header nav .nav-cta { padding: 9px 15px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); }

.business-hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 24px; width: min(1180px, calc(100% - 48px)); min-height: 500px; margin: 0 auto; }
.hero-copy { padding: 56px 0; }
.hero-copy h1 { max-width: 650px; margin: 14px 0 18px; font-size: clamp(42px, 6vw, 72px); line-height: 1.02; }
.hero-intro { max-width: 480px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 22px; }
.hero-cta { display: inline-flex; align-items: center; gap: 14px; padding: 13px 20px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); font-size: 15px; font-weight: 750; text-decoration: none; }
.build-like { color: var(--ink); font-size: 14px; font-weight: 700; text-underline-offset: 3px; }

/* hero art: shared */
.hero-art { position: relative; height: 380px; overflow: hidden; border-radius: calc(var(--radius) * 1.5); background: var(--soft); }
.art-tag { position: absolute; left: 24px; bottom: 24px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-family: var(--display); font-weight: var(--h-weight); text-transform: var(--h-case); }
/* outdoor */
.art-mountains .trail-sun { position: absolute; top: 50px; right: 70px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent); }
.art-mountains .peak { position: absolute; bottom: 0; width: 0; height: 0; border-style: solid; border-color: transparent; }
.art-mountains .peak-back { left: 10%; border-width: 0 200px 260px; border-bottom-color: color-mix(in srgb, var(--primary) 55%, var(--soft)); }
.art-mountains .peak-front { right: -40px; border-width: 0 230px 200px; border-bottom-color: var(--primary); }
/* studio */
.art-rings .ring { position: absolute; border-radius: 50%; border: 18px solid var(--primary); opacity: .9; }
.art-rings .ring-a { top: 40px; left: 18%; width: 220px; height: 220px; }
.art-rings .ring-b { top: 110px; left: 42%; width: 180px; height: 180px; border-color: var(--accent); }
.art-rings .ring-c { top: 20px; right: 8%; width: 90px; height: 90px; border-width: 10px; opacity: .5; }
/* pet */
.art-paws .blob { position: absolute; top: 40px; left: 18%; width: 280px; height: 250px; border-radius: 48% 52% 60% 40% / 55% 45% 55% 45%; background: color-mix(in srgb, var(--accent) 35%, var(--soft)); }
.paw { position: absolute; width: 56px; height: 56px; color: var(--primary); }
.paw i, .paw b { position: absolute; border-radius: 50%; background: currentColor; }
.paw i { width: 14px; height: 18px; top: 0; }
.paw i:nth-child(1) { left: 2px; top: 14px; } .paw i:nth-child(2) { left: 14px; } .paw i:nth-child(3) { left: 30px; } .paw i:nth-child(4) { left: 42px; top: 14px; }
.paw b { left: 12px; top: 26px; width: 32px; height: 28px; border-radius: 45% 45% 50% 50%; }
.paw-0 { top: 60px; right: 18%; transform: rotate(18deg); }
.paw-1 { top: 150px; right: 34%; transform: rotate(-10deg); }
.paw-2 { top: 230px; right: 14%; transform: rotate(24deg); color: var(--accent); }
.paw-3 { top: 40px; left: 12%; transform: rotate(-20deg) scale(.8); opacity: .6; }
/* tutor */
.art-graph { background-color: var(--surface); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; border: 1px solid var(--line); }
.graph-card { position: absolute; top: 60px; left: 50%; display: grid; gap: 10px; justify-items: center; padding: 26px 34px; border-radius: var(--radius); background: var(--accent); color: #1b2340; transform: translateX(-50%) rotate(-3deg); box-shadow: var(--shadow); font-family: var(--display); }
.graph-card .frac { font-size: 56px; font-weight: 800; line-height: 1; }
.graph-card .eq { font-size: 22px; font-weight: 700; }
.graph-card .check { position: absolute; top: -16px; right: -16px; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 20px; }
/* home */
.art-toolbox .stripe { position: absolute; inset: auto 0 0 0; height: 46px; background: repeating-linear-gradient(-45deg, var(--accent) 0 22px, var(--ink) 22px 44px); }
.tool-card { position: absolute; top: 70px; left: 50%; display: grid; gap: 8px; width: 260px; padding: 22px; border-left: 6px solid var(--primary); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transform: translateX(-50%); }
.tool-card b { font-family: var(--display); font-size: 22px; text-transform: var(--h-case); }
.tool-card span { color: var(--muted); font-size: 14px; }
.tool-card .tool-ok { color: var(--primary); font-weight: 700; }
/* research */
.art-notes { background: var(--surface); border: 1px solid var(--line); }
.note { position: absolute; padding: 16px 18px; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); font-family: var(--display); }
.note-a { top: 50px; left: 10%; max-width: 280px; font-size: 22px; transform: rotate(-2deg); }
.note-a mark { background: var(--accent); color: #141414; padding: 0 4px; }
.note-b { top: 190px; right: 10%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; transform: rotate(3deg); }
.note-c { bottom: 40px; left: 22%; font-size: 16px; font-style: italic; }

.offering-section { padding: 56px max(24px, calc((100% - 1180px) / 2)); background: var(--surface); border-block: 1px solid var(--line); }
.offering-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.offering-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.offering-card span { color: var(--accent); font-size: 12px; font-weight: 800; }
[data-theme="research"] .offering-card span, [data-theme="tutor"] .offering-card span { color: var(--primary); }
.offering-card h2 { margin: 12px 0 6px; font-size: 22px; }
.offering-card p { margin: 0; color: var(--muted); font-size: 15px; }

.info-section { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 10px; }
.info-section h2 { margin: 0 0 18px; font-size: clamp(26px, 3.4vw, 36px); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; }
.info-item { padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--soft); }
.info-item dt { font-weight: 800; }
.info-item dd { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.assistant-section { display: grid; grid-template-columns: 1fr minmax(330px, 470px); align-items: center; gap: 70px; width: min(1000px, calc(100% - 48px)); margin: 0 auto; padding: 70px 0 80px; }
.assistant-intro h2 { margin: 10px 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; }
.assistant-intro > p:not(.eyebrow) { color: var(--muted); }
.chat-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 15px 17px; background: var(--primary); color: var(--on-primary); }
.chat-head > div { display: grid; }
.chat-head b { font-size: 14px; }
.chat-head small { opacity: .8; font-size: 11px; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #53e08a; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }
.chat-messages { display: flex; min-height: 200px; max-height: 320px; flex-direction: column; gap: 10px; overflow-y: auto; padding: 17px; background: var(--bg); }
.chat-bubble { max-width: 88%; margin: 0; padding: 10px 12px; border-radius: min(var(--radius), 14px); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.assistant-bubble { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.user-bubble { align-self: flex-end; background: var(--primary); color: var(--on-primary); }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 14px; }
.suggestion { flex: 0 1 auto; padding: 7px 11px; text-align: left; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }
.suggestion:hover { border-color: var(--primary); color: var(--primary); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: min(var(--radius), 10px); background: var(--bg); color: var(--ink); font: inherit; }
.chat-form button { padding: 0 16px; border: 0; border-radius: min(var(--radius), 10px); background: var(--primary); color: var(--on-primary); font-weight: 750; cursor: pointer; }
.chat-status { min-height: 18px; margin: 0; padding: 0 14px 10px; color: var(--muted); font-size: 11px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.business-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.business-footer span { color: var(--muted); }
.business-footer a { color: var(--primary); font-weight: 750; text-decoration: none; }

@media (max-width: 860px) {
  .scenario-grid { grid-template-columns: repeat(2, 1fr); }
  .business-hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 44px 0 0; }
  .hero-art { height: 300px; margin-bottom: 32px; }
  .offering-grid, .info-grid { grid-template-columns: 1fr; }
  .assistant-section { grid-template-columns: 1fr; gap: 24px; padding: 52px 0; }
  .business-header nav a:not(.nav-cta) { display: none; }
}
@media (max-width: 480px) {
  .demo-header { padding: 16px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .demo-index { width: calc(100% - 32px); margin: 44px auto; }
  .business-header { padding: 12px 16px; }
  .business-brand { font-size: 15px; }
  .business-header nav .nav-cta { padding: 8px 11px; font-size: 12px; }
  .business-hero, .info-section, .assistant-section { width: calc(100% - 32px); }
  .offering-section { padding: 44px 16px; }
  .hero-copy h1 { font-size: 42px; }
  .hero-art { height: 260px; }
  .art-mountains .peak-back { border-width: 0 140px 180px; }
  .art-mountains .peak-front { border-width: 0 160px 140px; }
  .business-footer { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .scenario-card { transition: none; } }
