/* Hey Bath house style. Mobile first; desktop from 768px and 1100px.
   One source for the public site and admin. Tokens first, then base, layout, components. */

@font-face { font-family: 'Jakarta'; src: url('/assets/fonts/jakarta.woff2') format('woff2'); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jakarta'; src: url('/assets/fonts/jakarta-ext.woff2') format('woff2'); font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --font: 'Jakarta', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* ink and surfaces */
  --ink: #0e1018;
  --ink-2: #3c4150;
  --muted: #6b7080;
  --line: #e6e8ef;
  --line-soft: #eff1f6;
  --surface: #ffffff;
  --soft: #f5f6fa;
  --page: #f7f8fc;
  --wash: linear-gradient(180deg, #e8f0f8 0%, #efeafa 60%, #f7f8fc 100%);

  /* brand */
  --brand: #3d5afe;
  --brand-ink: #2a3ed6;
  --brand-grad: linear-gradient(135deg, #3b82f6 0%, #4f46e5 55%, #6d28d9 100%);
  --focus: 0 0 0 4px rgba(79, 70, 229, .22);

  /* topic tints: soft fill, deep ink, and the gradient used on hero cards */
  --lilac: #efe7ff;   --lilac-ink: #5b3db8;  --lilac-grad: linear-gradient(160deg, #c9b3fb 0%, #a68af2 100%);
  --peach: #ffe9e1;   --peach-ink: #b4472b;  --peach-grad: linear-gradient(160deg, #ffc3a8 0%, #f59a86 100%);
  --mint: #def7ea;    --mint-ink: #19784a;   --mint-grad: linear-gradient(160deg, #9be5bd 0%, #5fc08f 100%);
  --teal: #dcf3f6;    --teal-ink: #11707f;   --teal-grad: linear-gradient(160deg, #94dfea 0%, #5bbccb 100%);
  --sky: #e2ecff;     --sky-ink: #2b56c9;    --sky-grad: linear-gradient(160deg, #9cc0ff 0%, #4f7cf7 100%);
  --rose: #ffe6f1;    --rose-ink: #b02a6b;   --rose-grad: linear-gradient(160deg, #ffb8d6 0%, #f27aae 100%);
  --sun: #fff3d6;     --sun-ink: #8a5a00;    --sun-grad: linear-gradient(160deg, #ffd98a 0%, #f7b53d 100%);

  --ok: #19784a; --ok-bg: #def7ea; --warn: #8a5a00; --warn-bg: #fff3d6; --bad: #b42318; --bad-bg: #fee4e2;

  /* shape and depth */
  --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 28px; --pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(30, 41, 90, .18);
  --shadow-btn: 0 10px 24px -10px rgba(79, 70, 229, .7);

  /* spacing (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s24: 96px;
  --gutter: 16px;
  --max: 1120px;
}

/* ---- base ---------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink-2); background: var(--page);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; word-spacing: .03em; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
main, footer { overflow-wrap: anywhere; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 var(--s3); letter-spacing: -0.025em; line-height: 1.12; font-weight: 800; }
h1 { font-size: clamp(2.05rem, 7.5vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.06; }
h2 { font-size: clamp(1.6rem, 5.2vw, 2.5rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0 0 var(--s4); }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.075rem; color: var(--ink-2); max-width: 38rem; }
.eyebrow { display: inline-block; font-size: .8125rem; font-weight: 600; color: var(--brand); letter-spacing: .01em; margin-bottom: var(--s3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s8) 0; }
code { font-size: .85em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }

/* ---- layout -------------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s12) 0; }
.section-head { text-align: left; margin-bottom: var(--s8); }
.stack > * + * { margin-top: var(--s4); }
.grid { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.wash { background: var(--wash); }

@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .section { padding: var(--s16) 0; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section-head.center { text-align: center; margin-left: auto; margin-right: auto; max-width: 44rem; }
}
@media (min-width: 1100px) {
  .section { padding: var(--s24) 0; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---- header -------------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line-soft); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; }
.nav { display: none; gap: var(--s6); }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .9375rem; font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
@media (min-width: 768px) { .nav { display: flex; } }

/* ---- buttons ------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--pill);
  border: 0; font: 600 .9375rem/1 var(--font); letter-spacing: -0.005em; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--brand-grad); box-shadow: var(--shadow-btn); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .8); }
.btn-ghost { color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { color: var(--ink); border-color: #d5d8e2; }
.btn-danger { color: #fff; background: linear-gradient(135deg, #ef4444, #b42318); box-shadow: 0 10px 24px -10px rgba(180, 35, 24, .7); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn-block { width: 100%; }

/* ---- cards --------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); }
.card-lg { padding: var(--s6); }
@media (min-width: 768px) { .card { padding: var(--s6); } .card-lg { padding: var(--s8); } }
.card h3 { margin-bottom: var(--s2); }
.card p:last-child { margin-bottom: 0; }
.tile { background: var(--soft); border-radius: var(--r-lg); padding: var(--s5); }
.tile .icon, .card .icon { width: 40px; height: 40px; border-radius: var(--pill); background: var(--surface); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line); margin-bottom: var(--s3); font-size: 1.1rem; }
.panel { border-radius: var(--r-xl); padding: var(--s6); background: var(--lilac-grad); }

/* topic chips and tinted cards */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--pill); font-size: .8125rem; font-weight: 600;
  background: var(--soft); color: var(--ink-2); border: 1px solid var(--line-soft); }
.t-lilac { --tint: var(--lilac); --tint-ink: var(--lilac-ink); --tint-grad: var(--lilac-grad); }
.t-peach { --tint: var(--peach); --tint-ink: var(--peach-ink); --tint-grad: var(--peach-grad); }
.t-mint  { --tint: var(--mint);  --tint-ink: var(--mint-ink);  --tint-grad: var(--mint-grad); }
.t-teal  { --tint: var(--teal);  --tint-ink: var(--teal-ink);  --tint-grad: var(--teal-grad); }
.t-sky   { --tint: var(--sky);   --tint-ink: var(--sky-ink);   --tint-grad: var(--sky-grad); }
.t-rose  { --tint: var(--rose);  --tint-ink: var(--rose-ink);  --tint-grad: var(--rose-grad); }
.t-sun   { --tint: var(--sun);   --tint-ink: var(--sun-ink);   --tint-grad: var(--sun-grad); }
.chip[class*="t-"] { background: var(--tint); color: var(--tint-ink); border-color: transparent; }
.tinted { background: var(--tint); border-color: transparent; }
.tinted h3, .tinted .big { color: var(--tint-ink); }

/* gradient feature cards (testimonial-style): coloured body, white footer row with an arrow link */
.feature { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); padding: 6px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; }
a.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.feature-body { border-radius: calc(var(--r-lg) - 6px); background: var(--tint-grad); padding: var(--s5); min-height: 168px; color: var(--ink); display: flex; flex-direction: column; }
.feature-body h3 { color: var(--ink); font-size: 1.3rem; font-weight: 700; line-height: 1.25; margin: 0; }
.feature-body .kicker { font-size: .8125rem; font-weight: 600; color: rgba(14, 16, 24, .72); margin-top: auto; padding-top: var(--s4); }
.feature-foot { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s3) var(--s2); font-weight: 600; font-size: .9375rem; color: var(--ink); }
.feature-foot .arrow { color: var(--muted); }

/* stat rows: 2 up on phones, 4 up on desktop */
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(4, 1fr); gap: var(--s4); } }

/* topic strip: swipeable on phones, a row on desktop */
.topics { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) var(--s4); scrollbar-width: none; }
.topics::-webkit-scrollbar { display: none; }
.topics > * { scroll-snap-align: start; }
@media (min-width: 768px) { .topics { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; } }
@media (min-width: 1100px) { .topics { grid-template-columns: repeat(6, 1fr); } }
.topic .feature-body { min-height: 132px; }
.topic .feature-body h3 { font-size: 1.15rem; }

/* big number tiles */
.stat { border-radius: var(--r-lg); padding: var(--s4); background: var(--tint-grad, var(--brand-grad)); color: var(--ink); min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; }
.stat .big { font-size: clamp(2rem, 9vw, 2.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.stat .label { font-weight: 600; font-size: .875rem; line-height: 1.3; color: rgba(14, 16, 24, .72); }
@media (min-width: 768px) { .stat { padding: var(--s5); min-height: 132px; } }
.stat.plain { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.stat.plain .big { color: var(--ink); }
.stat.plain .label { color: var(--muted); }

/* ---- hero ---------------------------------------------------------------------------------- */
.hero { background: var(--wash); padding: var(--s10) 0 var(--s12); }
.hero + .section { padding-top: var(--s8); }
.sources .list li { padding: var(--s2) 0; }
.sources a { text-decoration: none; font-weight: 600; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-top: var(--s4); }
.trust { display: flex; align-items: center; gap: var(--s3); font-size: .875rem; color: var(--muted); margin-top: var(--s5); }
@media (min-width: 768px) { .hero { padding: var(--s16) 0; } .hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: var(--s10); align-items: center; } }

/* ---- forms --------------------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .875rem; color: var(--ink); margin: var(--s4) 0 6px; }
label:first-child { margin-top: 0; }
input, textarea, select { width: 100%; min-height: 48px; padding: 12px 14px; font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
textarea { min-height: 96px; resize: vertical; }
.composer textarea { resize: none; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #a5b4fc; box-shadow: var(--focus); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s6); box-shadow: var(--shadow-md); }
.form-card .btn { margin-top: var(--s5); }
.fine { font-size: .8125rem; color: var(--muted); margin-top: var(--s3); line-height: 1.5; }
.hp { position: absolute; left: -9999px; }

/* ---- prose (published pages and briefs) ------------------------------------------------------ */
.prose { max-width: 42rem; }
.prose h1 { margin-bottom: var(--s5); }
.prose h2 { font-size: 1.5rem; margin: var(--s10) 0 var(--s3); }
.prose h3 { margin: var(--s8) 0 var(--s2); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 var(--s4); }
.prose li { margin: 6px 0; }
.prose hr { margin: var(--s10) 0 var(--s6); }
.prose hr ~ p { font-size: .875rem; color: var(--muted); }

/* ---- lists and tables ---------------------------------------------------------------------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4) 0; border-top: 1px solid var(--line-soft); }
.list li:first-child { border-top: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 var(--s3) var(--s2); }
.table td { padding: var(--s3); border-top: 1px solid var(--line-soft); vertical-align: top; }
/* tables collapse to stacked rows on phones */
@media (max-width: 767px) {
  .table:not(.keep) thead { display: none; }
  .table:not(.keep), .table:not(.keep) tbody, .table:not(.keep) tr, .table:not(.keep) td { display: block; width: 100%; }
  .table:not(.keep) tr { padding: var(--s3) 0; border-top: 1px solid var(--line-soft); }
  .table:not(.keep) td { border: 0; padding: 2px 0; }
  .table:not(.keep) td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
}
.badge { display: inline-flex; align-items: center; flex: none; white-space: nowrap; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: .75rem; font-weight: 600; background: var(--soft); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }

/* ---- chat ---------------------------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: var(--s3); min-height: 40vh; padding: var(--s4); background: var(--soft); border-radius: var(--r-xl); }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 20px; font-size: .9375rem; line-height: 1.5; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; color: #fff; background: var(--brand-grad); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 6px; }
.bubble.typing { color: var(--muted); }
.composer { display: flex; gap: var(--s2); align-items: flex-end; margin-top: var(--s3); }
.composer textarea { min-height: 52px; border-radius: 26px; padding: 14px 18px; }
.composer .btn { min-height: 52px; }

/* ---- footer -------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s10) 0 var(--s12); font-size: .875rem; color: var(--muted); }
.site-footer .brand { font-size: 1rem; margin-bottom: var(--s4); }
.site-footer p { margin: 0 0 var(--s3); max-width: 46rem; line-height: 1.55; }
.site-footer .ai-note { margin: var(--s2) 0 var(--s5); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--s5); margin-bottom: var(--s4); }
.site-footer nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; }
.ai-note { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--pill); background: var(--sky); color: var(--sky-ink); font-weight: 600; font-size: .8125rem; margin-bottom: var(--s4); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- admin ---------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--pill); font-size: .875rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none; background: var(--surface); border: 1px solid var(--line); }
.tabs a[aria-current] { color: #fff; background: var(--ink); border-color: var(--ink); }
.tabs .count { margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--bad); color: #fff; font-size: .75rem; display: inline-grid; place-items: center; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); display: inline-block; }
.status-dot.off { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.meter { height: 8px; border-radius: var(--pill); background: var(--line-soft); overflow: hidden; margin-top: var(--s3); }
.meter > span { display: block; height: 100%; background: var(--brand-grad); border-radius: inherit; }
.pre { white-space: pre-wrap; font-size: .875rem; background: var(--soft); border-radius: var(--r-md); padding: var(--s4); overflow-x: auto; }
