/* Shell: announcement, sticky header with drawer, footer. Tokens only; geometry properties live on .sh.
   page.js loads this before base.css (shell.head() links it), so selectors stay class-based to win over base's element rules. */

/* announcement bar: scrolls away above the sticky header */
.sh-ann { background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 500; padding-top: env(safe-area-inset-top); }
.sh-ann-in { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sh-ann p { flex: 1; min-width: 0; padding: 10px 0; text-align: center; text-wrap: balance; }
.sh-ann a { color: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; text-decoration-thickness: 1px; }
.sh-ann a svg { flex: none; transition: transform var(--d) var(--ease); }
.sh-ann-x { flex: none; width: 44px; height: 44px; margin-right: -12px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; transition: background-color var(--d-fast) ease; }
.sh-ann :focus-visible { outline-color: currentColor; }
html:not([data-sh-js]) .sh-ann-x, html[data-sh-ann-off] .sh-ann { display: none; }
/* tell other blocks (hero's full height, base --header-h) how tall the bar is at rest; anchors land below it */
html:has(.sh) { --header-h: calc(72px + env(safe-area-inset-top)); scroll-padding-top: 80px; }
@media (max-width: 720px) { html:has(.sh) { --header-h: calc(60px + env(safe-area-inset-top)); } }

/* header: sticky, a real blur of the page behind it, condenses after 80px without moving the content below */
.sh { --sh-h: 72px; --sh-logo: 32px; --sh-word: 20px; position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); transition: margin-bottom var(--d) var(--ease); }
.sh[data-scrolled] { --sh-h: 56px; --sh-logo: 26px; --sh-word: 18px; margin-bottom: 16px; }
.sh::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: color-mix(in srgb, var(--ground) 72%, transparent); -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px); }
.sh[data-scrolled]::before { box-shadow: 0 1px 0 var(--line); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sh::before { background: var(--ground); } }
@media (prefers-reduced-transparency: reduce) { .sh::before { background: var(--ground); } }

.sh .sh-bar { height: var(--sh-h); display: flex; align-items: center; gap: 16px; padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); transition: height var(--d) var(--ease); }
.sh-logo { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 44px; max-width: 44vw; margin-right: auto; color: var(--ink); text-decoration: none; }
.sh-mark { display: block; min-width: 0; }
.sh-logo img { height: var(--sh-logo); width: auto; max-width: 100%; object-fit: contain; object-position: left center; transition: height var(--d) var(--ease); }
.sh-word { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 var(--sh-word)/1.2 var(--font-display); letter-spacing: -0.02em; transition: font-size var(--d) var(--ease); }

/* between 720px and the width the links need, the row scrolls rather than running under the actions (plan: Task 4) */
.sh-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 6px 4px; margin: -6px 0; }
.sh-nav::-webkit-scrollbar { display: none; }
.sh-links { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sh-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color var(--d-fast) ease, color var(--d-fast) ease; }
.sh-links a[aria-current="page"] { color: var(--brand); font-weight: 600; text-decoration: underline 2px; text-underline-offset: 8px; }

.sh-acts { flex: none; display: flex; align-items: center; gap: 4px; }
/* site.shell.menuSlot / cartSlot: the account menu and the shop's cart button move in on mount; empty until then */
.sh-slot { display: flex; align-items: center; }
.sh-slot:empty { display: none; }
.sh-cta { white-space: nowrap; margin-right: 4px; }
.sh-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); transition: background-color var(--d-fast) ease; }
/* theme-matched pairs: the toggle shows the theme it switches to; a dark logo file replaces the light one */
.sh-sun, .sh-dk, .sh-shut, .sh-menu { display: none; }
html[data-theme="dark"] :is(.sh-sun, .sh-dk) { display: block; }
html[data-theme="dark"] :is(.sh-moon, .sh-logo:has(.sh-dk) .sh-lt) { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) :is(.sh-sun, .sh-dk) { display: block; }
  html:not([data-theme="light"]) :is(.sh-moon, .sh-logo:has(.sh-dk) .sh-lt) { display: none; }
}

/* the one authored moment: the logo wipes in behind a brand sweep and settles, first page of a session only */
.sh[data-reveal] .sh-mark { -webkit-mask-image: linear-gradient(90deg, black 40%, transparent 60%); mask-image: linear-gradient(90deg, black 40%, transparent 60%); -webkit-mask-size: 250% 100%; mask-size: 250% 100%; -webkit-mask-position: 0 0; mask-position: 0 0; animation: sh-wipe .8s .1s var(--ease) both; }
.sh-sweep { position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 2px; background: var(--brand); clip-path: inset(0 0 0 100%); pointer-events: none; }
.sh[data-reveal] .sh-sweep { animation: sh-sweep .9s var(--ease) both; }
html[data-sh-seen] .sh .sh-mark, html[data-sh-seen] .sh .sh-sweep { animation: none; }
@keyframes sh-wipe {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; transform: translateX(-6px); }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; transform: none; }
}
@keyframes sh-sweep {
  0% { clip-path: inset(0 100% 0 0); }
  50% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 100%); }
}

/* footer: a sheet rising from the page; contact actions first, facts second, the ECT Act line last */
.sh-foot { margin-top: var(--section); padding: 56px 0 calc(32px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; }
.sh-foot-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 64px; align-items: start; }
.sh-who { display: flex; flex-direction: column; gap: 8px; }
.sh-name { font: 700 var(--t-h2)/1.1 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere; }
.sh-foot .sh-h { margin: 0 0 10px; font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: normal; color: var(--muted); }
.sh-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sh-rows a { display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background-color var(--d-fast) ease; }
.sh-rows svg { flex: none; color: var(--brand); }
.sh-label { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.sh-value { display: block; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sh-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px 48px; }
.sh-hours { margin: 0; }
.sh-hours div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sh-hours dt { font-weight: 500; }
.sh-hours dd { margin: 0; color: var(--muted); }
.sh-foot address { font-style: normal; max-width: 32ch; }
.sh-map { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.sh-social { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sh-social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field); transition: background-color var(--d-fast) ease, color var(--d-fast) ease, box-shadow var(--d-fast) ease; }
.sh-legal { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.sh-legal p:nth-child(2) { display: flex; flex-wrap: wrap; column-gap: 20px; }
.sh-legal p:nth-child(2) a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 500; }
.sh-small { font-size: 13px; }

@media (hover: hover) and (pointer: fine) {
  .sh-links a:hover, .sh-icon:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
  .sh-ann-x:hover { background: color-mix(in srgb, var(--surface) 16%, transparent); }
  .sh-ann a:hover svg { transform: translateX(3px); }
  .sh-rows a:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
  .sh-social a:hover { color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
}

@media (max-width: 720px) {
  .sh { --sh-h: 60px; --sh-logo: 28px; --sh-word: 18px; }
  .sh[data-scrolled] { --sh-h: 52px; --sh-logo: 24px; --sh-word: 17px; margin-bottom: 8px; }
  .sh .sh-bar { gap: 8px; }
  .sh-logo { flex: 0 1 auto; min-width: 0; } /* header slots (menuSlot, cartSlot) share the row: the wordmark gives way first */
  .sh-acts { gap: 0; }

  /* no JS: the links stay on screen as a scrollable row under the bar */
  html:not([data-sh-js]) .sh .sh-bar { height: auto; min-height: var(--sh-h); flex-wrap: wrap; }
  html:not([data-sh-js]) .sh-nav { order: 3; width: 100%; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 8px; }

  /* JS: the links become a full-height sheet under the bar, opened by the menu button */
  html[data-sh-js] .sh-menu { display: grid; }
  .sh[data-open] .sh-open { display: none; }
  .sh[data-open] .sh-shut { display: block; }
  .sh[data-open]::before { background: var(--surface); box-shadow: 0 1px 0 var(--line); }
  html[data-sh-js] .sh-nav { position: fixed; inset: var(--sh-y, 0px) 0 0 0; z-index: -1; margin: 0; overflow-y: auto; overscroll-behavior: contain; padding: calc(env(safe-area-inset-top) + var(--sh-h) + 12px) max(var(--pad), env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left)); background: var(--surface); visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path var(--d) var(--ease), visibility 0s var(--d); }
  html[data-sh-js] .sh[data-open] .sh-nav { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path var(--d-tick) var(--ease), visibility 0s; }
  html[data-sh-js] .sh-links { flex-direction: column; gap: 0; }
  html[data-sh-js] .sh-links a { width: 100%; min-height: 60px; padding: 0 4px; border-radius: 0; border-bottom: 1px solid var(--line); font: 600 24px/1.2 var(--font-display); letter-spacing: -0.02em; }
  html[data-sh-js] .sh-links a[aria-current="page"] { text-underline-offset: 6px; }
  .sh[data-open] .sh-links > li { animation: k-in var(--d-enter) calc(var(--i) * 50ms + 60ms) var(--ease) both; }
  html:has(.sh[data-open]) { overflow: hidden; }

  .sh-foot { padding-top: 40px; }
  .sh-foot-in { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* contact button and sheet (site.shell.contactButton): a corner pill on every page; a bottom sheet on phones, a side panel from 721px.
   Position knobs a site can set in brand.css:  .sh { --sh-fab-bottom: 88px; }  to clear a sticky action bar, --sh-fab-side to move it.
   Bottom-left, because the chat bubble and the shop's cart pill take the bottom-right. */
.sh { --sh-fab-side: 16px; --sh-fab-bottom: 16px; }
.sh-fab { position: fixed; z-index: 30; left: max(var(--sh-fab-side), env(safe-area-inset-left)); bottom: calc(var(--sh-fab-bottom) + env(safe-area-inset-bottom)); max-width: calc(100vw - 2 * var(--sh-fab-side)); min-height: 56px; padding: 0 22px 0 18px; display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 16px; font-weight: 600; line-height: 1.2; text-decoration: none; box-shadow: 0 1px 2px rgb(0 0 0 / .12), var(--shadow); animation: k-in var(--d-enter) .9s var(--ease) backwards; transition: transform .16s var(--ease), box-shadow var(--d) var(--ease); }
.sh-fab[hidden] { display: none; }
.sh-fab svg { flex: none; }
.sh-fab span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-fab:active { transform: scale(.98); }
.sh-fab:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sh[data-open] .sh-fab { display: none; }
html:has(.sh-fab) .sh-foot { padding-bottom: calc(88px + env(safe-area-inset-bottom)); } /* the pill never sits on the legal line */
@media print { .sh-fab, .sh-sheet { display: none; } }

.sh-sheet { margin: 0; padding: 0; border: 0; max-width: none; max-height: none; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; inset: auto 0 0 0; width: 100%; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; }
.sh-sheet[open] { display: flex; flex-direction: column; max-height: min(92dvh, 760px); animation: sh-sheet-in var(--d-enter) var(--ease) both; }
.sh-sheet::backdrop { background: color-mix(in srgb, black 45%, transparent); } /* black, not --ink: in dark mode ink is light */
.sh-sheet[open]::backdrop { animation: k-fade var(--d-tick) ease both; }
.sh-sheet[data-closing] { animation: sh-sheet-out var(--d) var(--ease) both; }
.sh-sheet[data-closing]::backdrop { animation: sh-scrim-out var(--d) ease both; }
.sh-sheet-in { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px var(--pad) calc(28px + env(safe-area-inset-bottom)); }
.sh-sheet-x { position: absolute; top: 10px; right: 10px; z-index: 1; background: var(--surface); }
.sh-sheet-body[aria-busy="true"] { min-height: 120px; }
.sh-sheet-link { margin: 20px 0 0; }
.sh-sheet-link .k-btn { width: 100%; }
/* the contact block, flat inside the sheet: no section padding, no card, a smaller heading clear of the close button */
.sh-sheet .ct { padding: 0; }
.sh-sheet .ct .k-wrap { padding-left: 0; padding-right: 0; }
.sh-sheet .ct .ct-grid { grid-template-columns: minmax(0, 1fr); row-gap: 18px; }
.sh-sheet .ct .ct-sheet { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.sh-sheet .ct .ct-head { padding-right: 44px; }
.sh-sheet .ct .ct-head h2 { font-size: var(--t-h3); line-height: 1.2; }
@keyframes sh-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sh-sheet-out { to { transform: translateY(100%); } }
@keyframes sh-scrim-out { to { opacity: 0; } }
@media (min-width: 721px) {
  .sh-sheet { inset: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; border-radius: var(--radius-sheet) 0 0 var(--radius-sheet); }
  .sh-sheet[open] { max-height: none; }
  .sh-sheet-in { padding-top: 32px; padding-bottom: 32px; }
  @keyframes sh-sheet-in { from { transform: translateX(100%); } to { transform: none; } }
  @keyframes sh-sheet-out { to { transform: translateX(100%); } }
}
@media (hover: hover) and (pointer: fine) {
  .sh-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 30%, transparent), var(--shadow); }
}
@media (prefers-reduced-motion: reduce) {
  .sh-fab { animation: k-fade .3s .5s ease both; transition: none; }
  .sh-sheet[open], .sh-sheet[open]::backdrop { animation: k-fade .2s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  .sh, .sh .sh-bar, .sh-logo img, .sh-word { transition: none; }
  .sh[data-reveal] .sh-mark { -webkit-mask-image: none; mask-image: none; animation: k-fade .3s ease both; }
  .sh[data-reveal] .sh-sweep { display: none; }
  html[data-sh-js] .sh-nav { clip-path: none; opacity: 0; transition: opacity var(--d) ease, visibility 0s var(--d); }
  html[data-sh-js] .sh[data-open] .sh-nav { opacity: 1; transition: opacity var(--d) ease, visibility 0s; }
  .sh[data-open] .sh-links > li { animation: k-fade .3s ease both; }
  .sh-ann a svg { transition: none; }
}
