/* SparkLab concept builds: shared layout. Each page sets its own look with the
   custom properties on :root (colours, fonts, corner radius) and a few overrides. */
:root {
  --bg: #F7F3EE; --paper: #FFFFFF; --ink: #2A2430; --muted: #6A6170; --line: rgba(42, 36, 48, .12);
  --accent: #6B4E8A; --accent-ink: #FFFFFF; --soft: #EFE8F3; --stage: #2B2236; --stage-ink: #F4EEF7;
  --display: Georgia, serif; --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px; --gutter: clamp(16px, 4vw, 40px); --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--body); overflow-x: hidden; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* honest banner: these businesses are invented */
.concept-note { position: relative; z-index: 50; padding: 10px var(--gutter); background: #17121D; color: #EDE6F2; font: 13px/1.5 system-ui, sans-serif; text-align: center; }
.concept-note a { color: #CDB4E8; }

/* header */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { font-family: var(--display); font-size: 1.35rem; text-decoration: none; margin-right: auto; white-space: nowrap; }
.top nav { display: flex; gap: 22px; font-size: .92rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .top nav { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: transform .25s, background-color .25s, color .25s; }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: .86rem; }

/* hero: copy beside the 3D island */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 14px 0 16px; font-size: clamp(2.3rem, 5.2vw, 4.1rem); }
.hero h1 em { color: var(--accent); }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.open-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--soft); font-size: .86rem; }
.open-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #B0A6B5; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .86rem; }
.tool input[type="range"] { accent-color: var(--accent); }
.open-badge.is-open::before { background: #3FA36B; box-shadow: 0 0 0 4px rgba(63, 163, 107, .18); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

.concept-note, main, .foot { position: relative; z-index: 1; }
.stage3d { aspect-ratio: 1 / 1.05; }
@media (max-width: 860px) { .stage3d { aspect-ratio: auto; height: min(78vw, 340px); } }
/* frosted panels, so the scene shows softly through the content */
.card, .agent, .tool, .panel { background: color-mix(in srgb, var(--paper) 74%, transparent); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
/* sections */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.alt { background: color-mix(in srgb, var(--paper) 22%, transparent); border-block: 1px solid var(--line); }
.head { max-width: 44rem; margin-bottom: clamp(26px, 4vw, 42px); }
.head h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); margin-top: 10px; }
.head p { margin-top: 12px; color: var(--muted); }

/* services / menu with filter tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tabs button { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; cursor: pointer; font-size: .9rem; }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { padding: 22px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); animation: rise .35s; }
.section.alt .card { background: var(--bg); }
.card[hidden] { display: none; }
.card h3 { font-size: 1.3rem; }
.card .meta { margin: 6px 0 10px; font-size: .86rem; color: var(--accent); font-weight: 600; }
.card p { font-size: .94rem; color: var(--muted); }

/* the assistants */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.agent { padding: 24px; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--line); }
.agent-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--accent); font-size: .74rem; font-weight: 600; letter-spacing: .04em; }
.agent h3 { font-size: 1.45rem; margin: 10px 0 6px; }
.agent > p { color: var(--muted); font-size: .94rem; margin-bottom: 16px; }
.agent-note { margin-top: 12px; font-size: .78rem; color: var(--muted); }

/* booking-style chat (studio/assistant.js) */
.chat-log { height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--soft); }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .94rem; line-height: 1.5; white-space: pre-wrap; animation: rise .3s; }
.msg.bot { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.error { align-self: flex-start; background: #FBEAEA; color: #8A2E2E; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chat-chip { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-size: .86rem; text-align: left; }
.chat-chip:hover { border-color: var(--accent); }
.chat-form, .faq-form { display: flex; gap: 8px; }
.chat-form input, .faq-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font: inherit; font-size: 16px; }
.chat-form button, .faq-ask { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.chat-form button:disabled, .faq-ask:disabled { opacity: .5; }
.typing, .sl-typing { display: inline-flex; gap: 4px; }
.typing span, .sl-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2), .sl-typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3), .sl-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* FAQ answerer (studio/faq-answerer.js) */
.faq-intro { color: var(--muted); font-size: .94rem; margin-bottom: 12px; }
.faq-list { display: grid; gap: 10px; margin-top: 6px; }
.faq-item { padding: 14px 16px; border-radius: var(--radius); background: var(--soft); animation: rise .3s; }
.faq-q { font-weight: 600; margin-bottom: 4px; }
.faq-a { color: var(--muted); font-size: .94rem; }

/* service matcher (studio/treatment-matcher.js) */
.tm-progress { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.tm-q { font-family: var(--display); font-size: 1.35rem; margin-bottom: 4px; }
.tm-hint { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.tm-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
@media (max-width: 420px) { .tm-opts { grid-template-columns: 1fr; } }
.tm-opt { min-height: 48px; padding: 8px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; text-align: left; font-size: .92rem; }
.tm-opt:hover { border-color: var(--accent); }
.tm-textarea { width: 100%; min-height: 90px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); font: inherit; font-size: 16px; }
.tm-go, .tm-book { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.tm-back, .tm-restart { margin-top: 12px; margin-left: 8px; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; }
.tm-result { padding: 18px; border-radius: var(--radius); background: var(--soft); }
.tm-result-kicker { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.tm-result-name { font-family: var(--display); font-size: 1.5rem; margin: 2px 0 6px; }
.tm-result-reason, .tm-caution { color: var(--muted); font-size: .94rem; }
.tm-caution { margin-top: 10px; }

/* estimator (workshop) and other small tools */
.tool { padding: 24px; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--line); }
.tool label { display: block; font-weight: 600; margin: 14px 0 6px; }
.tool select, .tool input[type="range"] { width: 100%; }
.tool select { min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font: inherit; font-size: 16px; }
.tool output { display: block; margin-top: 18px; font-family: var(--display); font-size: 2rem; color: var(--accent); }
.tool .fine { margin-top: 6px; font-size: .84rem; color: var(--muted); }

/* visit */
.visit { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours li.is-today { font-weight: 600; color: var(--accent); }
.address { font-size: 1.05rem; }
.address p + p { margin-top: 10px; color: var(--muted); font-size: .95rem; }
@media (max-width: 760px) { .visit { grid-template-columns: 1fr; } }

.foot { padding: 34px 0 46px; font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s, transform .8s; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
