/* Cedar & Stone — one stylesheet. Mobile-first at 390x844; ≥820px converts the
   bottom tab bar into a top nav (this is a public marketing site — desktop is a
   real audience, unlike ../wegoplace).

   Theme tokens follow the wegoplace three-layer rule:
     1. bare :root                                   — the COMPLETE light palette
     2. @media (prefers-color-scheme: dark)
        :root:not([data-theme])                      — dark overrides (system dark)
     3. :root[data-theme="dark"] / [data-theme="light"] — the in-app toggle wins
   Every color token must exist in layer 1; a token declared only inside a media
   query is how you ship black-on-black. theme-boot.js mirrors the two --ground
   values into the theme-color meta — change one, change the other. */

/* ---------- fonts (vendored; never CDN — the PWA owns its fonts offline) ---- */
@font-face {
  font-family: "Young Serif";
  src: url("/vendor/fonts/YoungSerif-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/vendor/fonts/HankenGrotesk-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/vendor/fonts/HankenGrotesk-Italic-var.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

/* ---------- layer 1: complete light palette ------------------------------- */
:root {
  color-scheme: light;

  --ground:   #f3eee3;   /* linen — mirrored in theme-boot.js + manifest */
  --ground-2: #ebe4d2;   /* deeper linen for alternating sections */
  --card:     #faf7ef;
  --ink:      #262219;
  --ink-2:    #6b6150;   /* muted copy — 5.4:1 on linen */
  --faint:    rgba(38, 34, 25, 0.14);   /* hairlines */
  --accent:     #3e5f41; /* moss — 6.1:1 on linen */
  --accent-ink: #f4efe2; /* text on moss */
  --accent-2:   #a34e2c; /* terracotta, sparingly — 5.0:1 on linen */
  --ok:   #22685f;       /* teal  \ deuteranopia-safe status pair; color is   */
  --warn: #7d5a0d;       /* gold  / never the only signal regardless          */
  --err:  #96371c;
  --barbg: rgba(243, 238, 227, 0.82);   /* tab bar / top nav glass */
  --shadow: 0 1px 2px rgba(38, 34, 25, 0.06), 0 8px 28px rgba(38, 34, 25, 0.09);
  --grain-op: 0.05; --grain-blend: multiply;
  /* faint topographic contours (the brand motif — terrain). One data URI per
     theme layer because background-image can't see currentColor. */
  --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%23262219' stroke-opacity='.09' stroke-width='1.3'%3E%3Cpath d='M-20 320c70-38 96-92 88-148S118 66 210 62s118 46 128 96 44 84 102 102'/%3E%3Cpath d='M-20 356c86-40 122-104 112-172S140 92 214 90s112 40 124 92 52 98 102 116'/%3E%3Cpath d='M-20 392c100-44 148-118 136-198S162 118 218 118s106 34 120 88 60 112 102 130'/%3E%3Cpath d='M4 284c56-34 74-80 68-128s54-92 138-96 106 40 116 84 40 74 94 92'/%3E%3C/g%3E%3C/svg%3E");

  /* safe areas: read env() exactly once, position everything off these */
  --sa-top: env(safe-area-inset-top, 0px);
  --sa-right: env(safe-area-inset-right, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left: env(safe-area-inset-left, 0px);
  --tabbar-h: 60px;
  --tabbar-space: calc(var(--tabbar-h) + var(--sa-bottom));

  --font-display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 12px;
  --maxw: 1080px;
}

/* ---------- layer 2: system dark ------------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ground:   #171309;
    --ground-2: #1e1a10;
    --card:     #221d12;
    --ink:      #eae3d1;
    --ink-2:    #a89c83;
    --faint:    rgba(234, 227, 209, 0.15);
    --accent:     #93b789;  /* sage — 7.4:1 on loam */
    --accent-ink: #14200f;
    --accent-2:   #d38f6a;
    --ok:   #5fa89b;
    --warn: #cfa64a;
    --err:  #d08064;
    --barbg: rgba(23, 19, 9, 0.8);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.4);
    --grain-op: 0.07; --grain-blend: overlay;
    --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%23eae3d1' stroke-opacity='.07' stroke-width='1.3'%3E%3Cpath d='M-20 320c70-38 96-92 88-148S118 66 210 62s118 46 128 96 44 84 102 102'/%3E%3Cpath d='M-20 356c86-40 122-104 112-172S140 92 214 90s112 40 124 92 52 98 102 116'/%3E%3Cpath d='M-20 392c100-44 148-118 136-198S162 118 218 118s106 34 120 88 60 112 102 130'/%3E%3Cpath d='M4 284c56-34 74-80 68-128s54-92 138-96 106 40 116 84 40 74 94 92'/%3E%3C/g%3E%3C/svg%3E");
  }
}

/* ---------- layer 3: explicit toggle -------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground:   #171309;
  --ground-2: #1e1a10;
  --card:     #221d12;
  --ink:      #eae3d1;
  --ink-2:    #a89c83;
  --faint:    rgba(234, 227, 209, 0.15);
  --accent:     #93b789;
  --accent-ink: #14200f;
  --accent-2:   #d38f6a;
  --ok:   #5fa89b;
  --warn: #cfa64a;
  --err:  #d08064;
  --barbg: rgba(23, 19, 9, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.4);
  --grain-op: 0.07; --grain-blend: overlay;
  --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%23eae3d1' stroke-opacity='.07' stroke-width='1.3'%3E%3Cpath d='M-20 320c70-38 96-92 88-148S118 66 210 62s118 46 128 96 44 84 102 102'/%3E%3Cpath d='M-20 356c86-40 122-104 112-172S140 92 214 90s112 40 124 92 52 98 102 116'/%3E%3Cpath d='M-20 392c100-44 148-118 136-198S162 118 218 118s106 34 120 88 60 112 102 130'/%3E%3Cpath d='M4 284c56-34 74-80 68-128s54-92 138-96 106 40 116 84 40 74 94 92'/%3E%3C/g%3E%3C/svg%3E");
}
/* forcing light needs no re-declarations — layer 1 IS light — but the attribute
   must defeat layer 2's media query, hence the explicit empty-feeling block. */
:root[data-theme="light"] { color-scheme: light; }

/* ---------- reset / base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* display:flex/grid on a class would otherwise beat the hidden attribute */
[hidden] { display: none !important; }
html { background: var(--ground); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* iOS standalone: dvh reports toolbar-short on cold start (measured in ../reader,
   docs/design.md — 894 vs true 956). Symptom of dvh here: dead strip at bottom. */
@media (display-mode: standalone) { body { min-height: 100vh; } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.17rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* paper grain over everything; pointer-events off so it's pure atmosphere */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- shell: header ------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--barbg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--faint);
  padding: calc(10px + var(--sa-top)) calc(18px + var(--sa-right)) 10px calc(18px + var(--sa-left));
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark {
  font-family: var(--font-display); font-size: 1.16rem; color: var(--ink);
  text-decoration: none; display: flex; align-items: baseline; gap: 2px; white-space: nowrap;
}
.wordmark .amp { color: var(--accent-2); font-style: italic; padding: 0 2px; }
.wordmark small {
  font-family: var(--font-body); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); margin-left: 8px;
}
.topnav { display: none; }  /* desktop only, below */

/* ---------- shell: bottom tab bar ----------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--barbg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--faint);
  padding: 0 var(--sa-right) var(--sa-bottom) var(--sa-left);
  height: var(--tabbar-space);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--ink-2);
  font-size: 0.68rem; font-weight: 550; letter-spacing: 0.02em;
  position: relative; -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 23px; height: 23px; }
/* active = color + weight + dot: three signals, never color alone */
.tab[aria-current="page"] { color: var(--accent); font-weight: 750; }
.tab[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px;
  border-radius: 50%; background: currentColor;
}
.tab .badge {
  position: absolute; top: 7px; right: calc(50% - 22px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent-2); color: var(--accent-ink);
  font-size: 0.66rem; font-weight: 750; line-height: 17px; text-align: center;
}
main { padding-bottom: calc(var(--tabbar-space) + 24px); }

/* ---------- layout helpers ------------------------------------------------ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 calc(18px + var(--sa-left)) 0 calc(18px + var(--sa-right)); }
.section { padding: 44px 0; }
.section-alt { background: var(--ground-2); border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); }
.eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-2); margin: 0 0 10px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent-2); }
.muted { color: var(--ink-2); }

/* ---------- buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--faint); }
.btn-quiet { background: transparent; color: var(--accent); border: none; padding: 8px 10px; font-weight: 650; }
.btn-danger { background: transparent; color: var(--err); border-color: currentColor; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; border-radius: 9px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { box-shadow: var(--shadow); }
  .btn-ghost:hover, .btn-quiet:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: none; }
  a.tab:hover { color: var(--ink); }
  .tab[aria-current="page"]:hover { color: var(--accent); }
}

/* ---------- cards / forms ------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--faint);
  border-radius: calc(var(--radius) + 4px); padding: 20px;
}
label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px;
}
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--faint); background: var(--card); color: var(--ink);
  transition: border-color 0.12s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.input { resize: vertical; min-height: 120px; }
.field-err { color: var(--err); font-size: 0.84rem; font-weight: 600; margin-top: 6px; display: flex; gap: 6px; align-items: baseline; }
.field-err::before { content: "✕"; font-size: 0.7rem; }
/* honeypot: visually gone, still submittable by bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- chips / badges / notices -------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--faint);
  background: var(--card); color: var(--ink-2); font-size: 0.84rem; font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 750; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.03em;
  border: 1px solid currentColor; text-transform: uppercase;
}
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); }
.pill.err { color: var(--err); } .pill.dim { color: var(--ink-2); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--faint); background: var(--ground-2);
  font-size: 0.9rem;
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice.warn { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--ground)); }

/* toast: bottom-center above the tab bar */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--tabbar-space) + 16px); z-index: 80;
  background: var(--ink); color: var(--ground); padding: 11px 18px;
  border-radius: 12px; font-size: 0.9rem; font-weight: 600;
  display: flex; gap: 8px; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(88vw, 480px);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast svg { width: 17px; height: 17px; flex: none; }

/* ---------- hero ---------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 2; padding-top: 40px; padding-bottom: 12px; }
.hero-kicker {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 14px;
}
.hero h1 { max-width: 13ch; margin-bottom: 18px; }
.hero .lede { font-size: 1.08rem; color: var(--ink-2); max-width: 46ch; margin-bottom: 26px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.hero-art { margin: 10px calc(-18px - var(--sa-left)) 0 calc(-18px - var(--sa-right)); position: relative; z-index: 1; }
.hero-art img {
  width: 100%; height: min(46vh, 340px); object-fit: cover;
  /* the photo's sharp band (planting + wall) sits in the upper third */
  object-position: center 30%; display: block;
}
/* soft blend from the page ground into the photo keeps it editorial, not slabby */
.hero-art::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 56px; z-index: 1;
  background: linear-gradient(var(--ground), transparent);
  pointer-events: none;
}
/* staggered load reveal — one orchestrated moment, CSS only */
.hero .rise { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero .rise:nth-child(2) { animation-delay: 0.08s; }
.hero .rise:nth-child(3) { animation-delay: 0.16s; }
.hero .rise:nth-child(4) { animation-delay: 0.24s; }
.hero-art { opacity: 0; animation: fade 1s ease 0.2s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* services grid on home */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.svc {
  background: var(--card); border: 1px solid var(--faint); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--ink);
}
.svc svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 10px; }
.svc b { display: block; font-size: 0.95rem; margin-bottom: 3px; }
.svc span { font-size: 0.82rem; color: var(--ink-2); }
.trust-strip { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.trust-strip li { display: flex; align-items: center; gap: 8px; list-style: none; }
.trust-strip { padding: 0; margin: 0; }
.trust-strip svg { width: 16px; height: 16px; color: var(--ok); }

/* numbered process steps on home */
.steps { list-style: none; counter-reset: step; margin: 22px 0; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps li::before {
  content: counter(step);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--accent-2); color: var(--accent-2);
  font-family: var(--font-display); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; margin-bottom: 2px; align-self: center; }
/* the description is the li's second grid child — without an explicit column
   it auto-places into the 44px number track and wraps one word per line */
.steps li > span { display: block; grid-column: 2; color: var(--ink-2); font-size: 0.92rem; }

/* footer */
.site-footer { border-top: 1px solid var(--faint); padding: 32px 0 24px; color: var(--ink-2); font-size: 0.88rem; background: var(--topo) var(--ground-2); }
.site-footer .wrap { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: inherit; }

/* ---------- auth card (portal) -------------------------------------------- */
.auth-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--ground-2); border-radius: 11px; padding: 4px; margin-bottom: 20px;
}
.auth-switch button {
  border: none; background: transparent; padding: 9px; border-radius: 8px;
  font-weight: 650; color: var(--ink-2);
}
.auth-switch button[aria-selected="true"] {
  background: var(--card); color: var(--ink); font-weight: 750;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---------- portal chat ---------------------------------------------------- */
/* The chat is the one app-like screen: it owns the viewport height instead of
   scrolling the document. 100dvh everywhere EXCEPT installed iOS — see the
   standalone 100vh hard rule at the top of this file. */
.portal-page.authed { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
@media (display-mode: standalone) { .portal-page.authed { height: 100vh; } }
.portal-page.authed main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: var(--tabbar-space); }
.portal-page.authed .site-footer { display: none; }
.chat-view { flex: 1; min-height: 0; display: flex; }
.chat-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 760px; }
.chat-head { padding: 14px 0 10px; border-bottom: 1px solid var(--faint); }
.chat-head b { font-family: var(--font-display); font-size: 1.05rem; display: block; }
.chat-head .muted { font-size: 0.84rem; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 2px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 0.95rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--faint); border-bottom-left-radius: 5px; }
.msg .msg-meta { display: block; font-size: 0.7rem; opacity: 0.75; margin-top: 4px; }
.msg .msg-meta svg { width: 12px; height: 12px; vertical-align: -2px; }
.chat-day { align-self: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding: 8px 0 2px; }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 12px; border-top: 1px solid var(--faint); }
.chat-composer textarea { min-height: 44px; max-height: 130px; border-radius: 14px; }
.chat-composer .btn { padding: 12px 14px; border-radius: 14px; }
.chat-empty { text-align: center; color: var(--ink-2); margin: auto; padding: 30px 20px; }
.chat-empty svg { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--accent); }

/* ---------- booking photo picker ------------------------------------------ */
.photo-drop {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
  border: 1.5px dashed var(--faint); border-radius: 10px; color: var(--ink-2);
  font-weight: 650; font-size: 0.92rem; cursor: pointer;
}
.photo-drop svg { width: 20px; height: 20px; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-previews .ph {
  position: relative; width: 86px; height: 86px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--faint);
}
.photo-previews .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews .ph button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.55); color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.photo-previews .ph button svg { width: 12px; height: 12px; }

/* ---------- before/after slider ------------------------------------------- */
.ba {
  position: relative; margin: 0; overflow: hidden;
  border-radius: calc(var(--radius) + 4px); border: 1px solid var(--faint);
  aspect-ratio: 8 / 5; background: var(--ground-2);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  cursor: ew-resize;
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-after { clip-path: inset(0 0 0 var(--split)); }
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 3px;
  background: var(--card); transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.ba-handle {
  position: absolute; top: 50%; left: var(--split); transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--card); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: ew-resize;
}
.ba-handle svg { width: 22px; height: 22px; }
.ba-label {
  position: absolute; bottom: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(20, 18, 12, 0.55); color: #f4efe2;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ba-l-before { left: 10px; }
.ba-l-after { right: 10px; }
.ba-caption { margin: 12px 2px 0; font-size: 0.92rem; }

/* lightbox reusing the slider */
.lightbox {
  border: none; padding: 0; background: transparent;
  width: min(94vw, 900px); max-height: 92vh;
}
.lightbox::backdrop { background: rgba(12, 10, 6, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lightbox-inner { position: relative; background: var(--ground); border-radius: calc(var(--radius) + 6px); padding: 14px; }
.lightbox-inner .ba-caption { color: var(--ink); }
.lightbox-close {
  position: absolute; top: -14px; right: -8px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--faint);
  background: var(--card); color: var(--ink);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.lightbox-close svg { width: 17px; height: 17px; }

/* ---------- work grid ------------------------------------------------------ */
.work-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 22px; }
.work-card { border: 1px solid var(--faint); border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--card); }
.work-thumb {
  display: block; width: 100%; border: none; padding: 0; background: var(--ground-2);
  position: relative; cursor: pointer; aspect-ratio: 8 / 5;
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.compare-hint {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(20, 18, 12, 0.55); color: #f4efe2;
  font-size: 0.74rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.compare-hint svg { width: 15px; height: 15px; }
.work-card .work-card-body { padding: 14px 16px 16px; }
.work-card h3 { margin-bottom: 4px; }
.work-card p { color: var(--ink-2); font-size: 0.9rem; margin: 0 0 10px; }
.work-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.work-card .tag {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px; padding: 2px 9px;
}

/* ---------- admin ---------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  display: block; background: var(--card); border: 1px solid var(--faint);
  border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink);
}
.stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; }
.stat span { font-size: 0.8rem; color: var(--ink-2); font-weight: 600; }
.stat.hot { border-color: var(--accent-2); }
.stat.hot span { color: var(--accent-2); }

.admin-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--faint); border-radius: var(--radius);
  padding: 10px 14px; text-decoration: none; color: var(--ink);
  flex-wrap: wrap;
}
.admin-row.unread { border-color: var(--accent); }
.admin-row.unread .admin-row-body b { font-weight: 800; }
.admin-row-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 7px; background: var(--ground-2); flex: none; }
.admin-row-body { flex: 1; min-width: 140px; }
.admin-row-body b { display: block; font-size: 0.95rem; }
.admin-row-body .muted { display: block; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.admin-row-actions { display: flex; align-items: center; gap: 4px; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--faint);
  background: transparent; color: var(--ink); font-size: 1rem;
}
.iconbtn[disabled] { opacity: 0.3; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 750; font-size: 1.05rem;
}
.badge-inline {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent-2); color: var(--accent-ink);
  font-size: 0.7rem; font-weight: 750; line-height: 18px; text-align: center;
  vertical-align: 2px;
}

.ba-uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-slot {
  display: flex; align-items: center; justify-content: center; position: relative;
  aspect-ratio: 8 / 5; border: 1.5px dashed var(--faint); border-radius: 10px;
  color: var(--ink-2); font-weight: 650; font-size: 0.88rem; cursor: pointer;
  overflow: hidden; background: var(--ground-2);
}
.upload-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-slot .upload-swap {
  position: absolute; bottom: 6px; right: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(20, 18, 12, 0.55); color: #f4efe2; font-size: 0.7rem;
}
.upload-slot.filled { border-style: solid; }

.email-row { background: var(--card); border: 1px solid var(--faint); border-radius: 10px; padding: 0; }
.email-row summary {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer; font-size: 0.88rem; list-style: none;
}
.email-row summary::-webkit-details-marker { display: none; }
.email-row b { font-size: 0.9rem; }
.email-row pre {
  margin: 0; padding: 12px 14px; border-top: 1px solid var(--faint);
  white-space: pre-wrap; font-size: 0.82rem; overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- desktop: tab bar becomes top nav ------------------------------ */
@media (min-width: 820px) {
  .tabbar { display: none; }
  main { padding-bottom: 40px; }
  #toast { bottom: 28px; }
  .topnav { display: flex; align-items: center; gap: 26px; }
  .topnav a {
    text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: 0.94rem;
    padding: 4px 2px; position: relative;
  }
  .topnav a[aria-current="page"] { color: var(--accent); }
  .topnav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
    background: currentColor; border-radius: 1px;
  }
  .topnav a.nav-cta { color: var(--accent-ink); background: var(--accent); padding: 9px 18px; border-radius: 10px; }
  .topnav a.nav-cta[aria-current="page"]::after { content: none; }
  .topnav .badge {
    display: inline-block; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 6px;
    border-radius: 9px; background: var(--accent-2); color: var(--accent-ink);
    font-size: 0.66rem; font-weight: 750; line-height: 17px; text-align: center;
  }
  .svc-grid { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-page.authed main { padding-bottom: 0; }
  /* wide editorial crop for the featured slider so it doesn't swallow the fold */
  #ba-featured .ba { aspect-ratio: 16 / 7; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 64px 0; }
  .hero .wrap { padding-top: 76px; }
  .hero h1 { font-size: 4rem; }
  .hero .lede { font-size: 1.15rem; }
  .hero-art { margin-top: 8px; }
  .hero-art img { height: 500px; }
}
@media (hover: none) { .topnav { -webkit-tap-highlight-color: transparent; } }

/* ---------- motion discipline --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* cross-document page transitions: pure progressive enhancement (Chrome 126+,
   Safari 18.2+; Firefox ignores the at-rule and gets plain navigation) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation-duration: 0.16s; }
  ::view-transition-new(root) { animation-duration: 0.16s; }
}
