/* ==========================================================================
   Peaceful Pathways Worcester — site styles
   Sage theme. Colours and fonts are set once here as variables.
   ========================================================================== */

:root {
  --ground: #F3F5F1;
  --surface: #FFFFFF;
  --mist: #E4ECE5;
  --line: #DCE3DA;
  --ink: #1F332D;
  --ink-strong: #1B342C;
  --ink-soft: #3A5048;
  --ink-muted: #4D6B60;
  --accent: #3F6B5C;
  --accent-hover: #2F5246;
  --forest: #1F3A33;
  --forest-deep: #172C26;
  --on-forest: #F3F5F1;
  --on-forest-soft: #C9D8CD;
  --placeholder: #CFDCD2;
  --field-border: #A9B8AE;
  --header-bg: rgba(243, 245, 241, .92);
  --field-bg: #FFFFFF;
  --btn-bg: var(--accent);
  --btn-bg-hover: var(--accent-hover);
  --on-ink: #FFFFFF;
  --error: #A23B2A;
  --grain-opacity: .045;

  --font-display: "Marcellus", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --radius: 20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Dark theme: light is the default. Dark only applies when a visitor picks it with the footer toggle. */
:root[data-theme="dark"] {
  --ground: #111A16; --surface: #18231E; --mist: #1D2B25; --line: #2A3B34;
  --ink: #E3EBE5; --ink-strong: #F3F5F1; --ink-soft: #BCCEC3; --ink-muted: #98B2A5;
  --accent: #86B8A3; --accent-hover: #A9D3C0;
  --forest: #26443A; --forest-deep: #0B120F; --on-forest: #F3F5F1; --on-forest-soft: #C9D8CD;
  --placeholder: #22332C; --field-border: #4B6358;
  --header-bg: rgba(17, 26, 22, .92); --field-bg: #131D19;
  --btn-bg: #3F6B5C; --btn-bg-hover: #4E7F6D; --on-ink: #111A16; --error: #F0A596;
  --grain-opacity: .07;
  color-scheme: dark;
}
:root[data-theme="dark"] .photo img { filter: brightness(.6) saturate(.85); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* never let a wide element push the page (and the sticky header) sideways; clip keeps sticky working */
}

img { max-width: 100%; display: block; }

a { color: var(--accent-hover); transition: color .25s var(--ease); }
a:hover { color: var(--ink-strong); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; color: var(--ink-strong); margin: 0; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.1; }
h2 { font-size: clamp(2rem, 3.5vw, 2.5rem); line-height: 1.2; }
h3 { font-size: 1.4rem; line-height: 1.3; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.section { padding-block: 96px; }
.section--white { background: var(--surface); }
.section--mist { background: var(--mist); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.soft { color: var(--ink-soft); }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 34rem; }
.small-print { font-size: .9rem; color: var(--ink-muted); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--forest); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 16px; color: #fff; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 30px;
  border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--btn-bg); color: #fff; }
.btn--primary:hover { background: var(--btn-bg-hover); color: #fff; box-shadow: 0 10px 24px -12px rgba(31, 58, 51, .6); }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--on-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }

.link-strong { font-weight: 700; }

/* ---------- Header & navigation ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { transition: transform 1.2s var(--ease); }
.brand:hover svg { transform: rotate(90deg); }
.brand__name { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .02em; }
@media (max-width: 480px) { .brand__name { font-size: clamp(.82rem, 4.4vw, 1.05rem); white-space: nowrap; } .brand { gap: 8px; } .brand svg { width: 28px; height: 28px; } .site-header .wrap { padding-inline: 14px; } }

.nav { display: flex; align-items: center; gap: 8px 28px; font-weight: 600; font-size: .95rem; }
.nav a:not(.btn) {
  position: relative; text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:not(.btn):hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink-strong); }
.nav .btn { min-height: 44px; padding: 10px 22px; }
.nav .btn[aria-current="page"] { background: var(--ink-strong); color: var(--on-ink); }

@media (max-width: 1040px) {
  /* Small screens: the whole header stays pinned, with the links in one row under the brand. */
  .site-header { background: var(--ground); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header__inner { flex-direction: column; align-items: stretch; gap: 0; padding-block: 0; }
  .brand { height: 42px; justify-content: center; padding-top: 4px; }
  .nav {
    height: 48px; flex-wrap: nowrap; justify-content: space-between; gap: 0 6px;
    font-size: clamp(.8rem, 3.8vw, .95rem);
  }
  .nav a:not(.btn) { min-height: 48px; }
  .nav a:not(.btn)::after { bottom: 8px; }
  .nav .btn { min-height: 36px; padding: 6px clamp(12px, 4vw, 20px); }
}
@media (min-width: 1041px) { .nav__x { display: inline; } }
@media (max-width: 1040px) { .nav__x { display: none; } }
@media (max-width: 1040px) { html { scroll-padding-top: 96px; } }

/* ---------- Hero ---------- */

.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-block: 88px 96px; }
.hero__text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero__media { flex: 1 1 380px; min-width: 0; }

.page-intro { display: flex; flex-wrap: wrap; gap: 56px; padding-block: 88px; }
.page-intro__title { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.page-intro__body { flex: 2 1 520px; min-width: 0; padding-top: 8px; }
.page-intro h1 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); line-height: 1.15; }

/* ---------- Photos ---------- */

.photo { overflow: hidden; background: var(--placeholder); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 8s var(--ease); }
.photo--arch { height: 30rem; border-radius: 240px 240px 24px 24px; }
.photo--arch-tall { height: 32rem; border-radius: 240px 240px 24px 24px; }
.photo--rounded { height: 26rem; border-radius: 24px; }
.photo:hover img { transform: scale(1.04); }

/* ---------- Section headers ---------- */

.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 40px;
}
.section-head__text { display: flex; flex-direction: column; gap: 12px; max-width: 40rem; }

/* ---------- Grids & cards ---------- */

.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 32px; }
.grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 40px; }

.card {
  border-radius: var(--radius); padding: 32px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.card--soft { background: var(--ground); }
.card--white { background: var(--surface); }
.card--outline { background: var(--surface); border: 1px solid var(--line); }
.card--forest { background: var(--forest); color: var(--on-forest); }
.card--forest h2, .card--forest h3 { color: var(--on-forest); }
.card--forest a { color: #fff; }
.card .icon { width: 32px; height: 32px; color: var(--accent); }

a.card { text-decoration: none; color: inherit; gap: 8px; }
a.card--forest, a.card--forest:hover { color: var(--on-forest); }
a.card:hover, .card--lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -24px rgba(23, 44, 38, .45);
}
a.card--outline:hover { border-color: var(--accent); }

.card__title { font-family: var(--font-display); font-size: 1.5rem; }
.price { font-weight: 700; color: var(--ink-muted); }
.card--forest .price, .card--forest .eyebrow { color: var(--on-forest-soft); }
.card--forest .soft { color: #E3EAE4; }
.card--treatment { padding: 36px; gap: 14px; }
.card--treatment .soft { flex-grow: 1; }
.card--treatment h2 { font-size: 1.6rem; }

/* ---------- Steps ---------- */

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; flex-direction: column; gap: 10px; }
.steps__num { font-family: var(--font-display); font-size: 2rem; color: var(--accent); }
.steps h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; color: var(--ink); }

/* ---------- Testimonials ---------- */

.quote { margin: 0; }
.quote blockquote { margin: 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.5; }
.quote figcaption { color: var(--ink-muted); font-weight: 600; }

/* ---------- FAQ ---------- */

.faq { max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .3s var(--ease);
}
.faq details:hover, .faq details[open] { border-color: var(--field-border); }
.faq summary {
  list-style: none; cursor: pointer; font-weight: 700;
  padding: 20px 56px 20px 24px; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%;
  width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq .answer { padding: 0 24px 22px; color: var(--ink-soft); }

/* Smooth open/close in browsers that support it; others simply snap. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content {
    block-size: 0; overflow: hidden;
    transition: block-size .4s var(--ease), content-visibility .4s allow-discrete;
  }
  .faq details[open]::details-content { block-size: auto; }
}

/* ---------- Call to action ---------- */

.cta { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.cta p { max-width: 32rem; }

/* ---------- Booking ---------- */

.contact-list { display: flex; flex-direction: column; gap: 20px; padding-top: 16px; }
.contact-list dt {
  font-weight: 700; font-size: .85rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-muted);
}
.contact-list dd { margin: 2px 0 0; }

.split { display: flex; flex-wrap: wrap; gap: 56px; }
.split > * { flex: 1 1 400px; min-width: 0; }

.form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 36px; display: flex; flex-direction: column; gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink);
  padding: 12px 14px; min-height: 48px;
  border: 1px solid var(--field-border); border-radius: 10px; background: var(--field-bg);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 107, 92, .2);
}
.field--check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: .95rem; }
.field--check input { min-height: 0; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.field--check label { font-weight: 400; }
.hp { position: absolute; left: -9999px; }
.form .btn { align-self: flex-start; }
.form-status { min-height: 1.6em; font-weight: 600; }
.form-status.is-ok { color: var(--accent-hover); }
.form-status.is-error { color: var(--error); }

/* ---------- Prose (privacy page) ---------- */

.prose { max-width: 46rem; display: flex; flex-direction: column; gap: 16px; color: var(--ink-soft); }
.prose h2 { font-size: 1.6rem; margin-top: 24px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--forest-deep); color: var(--on-forest-soft); font-size: .9rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: #E3EAE4; }
.site-footer a:hover { color: #fff; }

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Atmosphere
   ========================================================================== */

/* Soft paper grain over the whole page. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--grain-opacity);
  background-size: 180px 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .6 0 0 0 0 .55 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Hero: a slow breathing glow and a ring behind the picture. */
.hero { overflow-x: clip; }
.hero__media { position: relative; }
.hero__media::before, .hero__media::after {
  content: ""; position: absolute; pointer-events: none; z-index: -1; border-radius: 50%;
}
.hero__media::before {
  inset: -8% -8px; /* px, not %: it must stay inside the 24px page padding or phones widen the page */
  background: radial-gradient(closest-side, rgba(134, 184, 163, .42), rgba(134, 184, 163, 0) 72%);
  animation: breathe-glow 10s ease-in-out infinite;
}
.hero__media::after {
  inset: -3% -4px; border: 1.5px solid var(--accent); opacity: .25;
  animation: breathe-ring 10s ease-in-out infinite;
}
@keyframes breathe-glow { 0%, 100% { transform: scale(.9); opacity: .5; } 40% { transform: scale(1.06); opacity: 1; } }
@keyframes breathe-ring { 0%, 100% { transform: scale(.96); opacity: .15; } 40% { transform: scale(1.03); opacity: .35; } }

/* Gentle wave edges on the tinted sections. */
.section--white, .section--mist {
  position: relative; --sec-bg: var(--surface);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V22C180 4 360 2 540 14s360 24 540 12 270-20 360-14V40z'/%3E%3C/svg%3E");
}
.section--mist { --sec-bg: var(--mist); }
.section--white::before, .section--white::after,
.section--mist::before, .section--mist::after {
  content: ""; position: absolute; left: 0; right: 0; height: clamp(22px, 4vw, 44px);
  background: var(--sec-bg); pointer-events: none;
  -webkit-mask: var(--wave) center / 100% 100% no-repeat; mask: var(--wave) center / 100% 100% no-repeat;
}
.section--white::before, .section--mist::before { top: 1px; transform: translateY(-100%); }
.section--white::after, .section--mist::after { bottom: 1px; transform: translateY(100%) scaleY(-1); }

/* Pause and breathe */
.breathe { display: none; }
.js .breathe {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px;
}
.breathe__text { flex: 1 1 320px; max-width: 30rem; }
.breathe__stage { flex: 0 0 auto; display: grid; place-items: center; width: min(300px, 72vw); aspect-ratio: 1; }
.breathe__orb {
  grid-area: 1 / 1; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--mist), var(--placeholder));
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 60px -10px rgba(134, 184, 163, .5);
  transform: scale(.62);
}
.breathe.is-running .breathe__orb { animation: breathe-orb 10s ease-in-out infinite; }
@keyframes breathe-orb { 0%, 100% { transform: scale(.62); } 40% { transform: scale(1); } }
.breathe__label {
  grid-area: 1 / 1; position: relative; text-align: center; padding: 0 16px;
  font-family: var(--font-display); font-size: 1.5rem; color: var(--ink-strong);
}

/* ==========================================================================
   Chips, treatment picker, booking helpers
   ========================================================================== */

fieldset.chip-field { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.chip-field legend { font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px;
  border: 1.5px solid var(--field-border); border-radius: 999px; cursor: pointer; font-weight: 600;
  background: var(--field-bg);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.chip:hover span { border-color: var(--accent); }
.chip input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }

.js-only { display: none; }
.js .js-only { display: block; }
.js .picker.js-only { display: flex; }

.picker { margin-bottom: 40px; gap: 22px; border: 1px solid var(--line); }
.picker h2 { font-size: 1.6rem; }
.picker__result {
  border-radius: 16px; background: var(--mist); padding: 24px;
  display: flex; flex-direction: column; gap: 10px; animation: pop-in .5s var(--ease);
}
.picker__result[hidden] { display: none; }
.picker__result h3 { font-size: 1.5rem; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } }

.form-hint { font-size: .9rem; color: var(--ink-muted); }
.form-hint a { font-weight: 700; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.contact-actions .btn { min-height: 44px; padding: 8px 20px; font-size: .95rem; }

/* ==========================================================================
   Footer theme toggle
   ========================================================================== */

.theme-toggle {
  font: inherit; color: #E3EAE4; background: transparent; cursor: pointer;
  border: 1px solid rgba(227, 234, 228, .35); border-radius: 999px; padding: 6px 14px; min-height: 36px;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.theme-toggle:hover { background: rgba(255, 255, 255, .1); border-color: #E3EAE4; }
.site-footer__tools { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }

/* ==========================================================================
   Quick-answers assistant (canned replies, no server)
   ========================================================================== */

.qa-launch {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  display: none; align-items: center; gap: 10px;
  /* Own compositing layer and a fixed transition name keep it still while scrolling and between pages. */
  transform: translateZ(0); will-change: transform; view-transition-name: qa-launch;
  min-height: 52px; padding: 12px 20px 12px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--btn-bg); color: #fff; font: inherit; font-weight: 700;
  box-shadow: 0 14px 30px -12px rgba(23, 44, 38, .6);
  transition: transform .3s var(--ease), background-color .3s var(--ease), opacity .3s var(--ease);
}
.js .qa-launch { display: inline-flex; }
.qa-launch:hover { background: var(--btn-bg-hover); }
@media (hover: hover) { .qa-launch:hover { transform: translate3d(0, -2px, 0); } }
.qa-launch svg { width: 22px; height: 22px; flex: none; }
.qa-open .qa-launch { opacity: 0; pointer-events: none; }

.qa-panel {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 61;
  width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 30px 70px -24px rgba(11, 18, 15, .55);
  transform-origin: bottom right;
  transition: transform .35s var(--ease), opacity .3s var(--ease), visibility 0s linear .35s;
  transform: translateY(16px) scale(.97); opacity: 0; visibility: hidden;
}
.qa-open .qa-panel { transform: none; opacity: 1; visibility: visible; transition: transform .35s var(--ease), opacity .3s var(--ease), visibility 0s; }

.qa-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 12px 14px 20px; background: var(--forest); color: var(--on-forest);
}
.qa-head h2 { font-size: 1.2rem; color: var(--on-forest); }
.qa-head p { font-size: .82rem; color: var(--on-forest-soft); }
.qa-close {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--on-forest); font-size: 1.6rem; line-height: 1;
}
.qa-close:hover { background: rgba(255, 255, 255, .12); }

.qa-log {
  position: relative;
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--ground); overscroll-behavior: contain;
}
.qa-msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; font-size: .98rem; line-height: 1.5; animation: pop-in .35s var(--ease); }
.qa-msg p + p { margin-top: 8px; }
.qa-msg--bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.qa-msg--me { align-self: flex-end; background: var(--btn-bg); color: #fff; border-bottom-right-radius: 6px; }
.qa-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qa-links a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px;
  background: var(--mist); color: var(--ink-strong); text-decoration: none; font-size: .9rem; font-weight: 700;
}
.qa-links a:hover { background: var(--placeholder); }
.qa-typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.qa-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); animation: qa-dot 1.1s ease-in-out infinite; }
.qa-typing i:nth-child(2) { animation-delay: .15s; }
.qa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes qa-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.qa-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 2px; }
.qa-suggest button {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-align: left;
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); color: var(--ink-strong); border: 1.5px solid var(--field-border);
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.qa-suggest button:hover { border-color: var(--accent); background: var(--mist); }

.qa-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.qa-form input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--field-bg);
  border: 1px solid var(--field-border); border-radius: 999px; padding: 10px 16px; min-height: 46px;
}
.qa-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 107, 92, .25); }
.qa-form button {
  flex: none; min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--btn-bg); color: #fff; font: inherit; font-weight: 700;
}
.qa-form button:hover { background: var(--btn-bg-hover); }

@media (max-width: 520px) {
  .qa-launch { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); padding: 14px; }
  .qa-launch span { display: none; }
  .qa-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(78dvh, 640px); }
}

/* ---------- Page transitions (supporting browsers only) ---------- */

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }
.site-header { view-transition-name: site-header; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
  .hero__media::before, .hero__media::after,
  .breathe.is-running .breathe__orb, .qa-typing i { animation: none; }
  .breathe.is-running .breathe__orb { transform: scale(.8); }
}
