/* The home page's header capsule (meadow/styles.css, copied by meadow-work/patch-work.mjs on each build). */
/* ---------- capsule: day/night and the menu (Dec 2) ----------
   [ sun/moon | Menu ] in one glass pill beside "Get in touch". The header row never changes shape: when the menu is open
   the Menu half only reads "Close". The panel is its own piece of glass that drops in under the capsule, right edges
   aligned (capsule.js measures its width into --w1: about 300px on a desktop, the header's inner width on a phone).
   meadow-work/patch-work.mjs copies this block, from this comment to "capsule end", to every subpage. */
.cap {
  --cap-h: 2.75rem; --cap-ease: cubic-bezier(0.23, 1, 0.32, 1); --cap-ink: #1f2a2a; --cap-ink-2: #4a5552; --cap-teal: #165660;
  position: relative; z-index: 1; flex: none; height: var(--cap-h);
}
.cap-row { position: relative; z-index: 2; display: flex; align-items: stretch; height: 100%; color: var(--cap-ink); }
/* the pill's glass: a layer behind the two buttons (so the header's intro can fade it without touching .cap itself) */
.cap .cap-body.button {
  position: absolute; inset: 0; z-index: 1; display: block; min-height: 0; padding: 0; border-radius: 22px;
  transform: none !important; --lift: 0px; --press: 0; pointer-events: none;
}

/* the two halves: each its own 44px button */
.cap-mode, .cap-menu {
  position: relative; display: flex; align-items: center; justify-content: center; min-width: var(--cap-h); height: 100%;
  margin: 0; border: 0; background: none; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font: 500 0.9375rem/1 Inter, "Inter Fallback", "Helvetica Neue", Arial, system-ui, sans-serif; letter-spacing: -0.01em;
}
.cap-mode { width: var(--cap-h); padding: 0; border-radius: 22px 0 0 22px; }
.cap-menu { gap: 8px; padding: 0 1.05rem 0 0.9rem; border-radius: 0 22px 22px 0; }
.cap-row > .cap-menu:first-child { padding-left: 1.05rem; border-radius: 22px; }   /* subpages without a night: just Menu */
.cap-rule { flex: none; align-self: center; width: 1px; height: 18px; background: rgb(31 42 42 / 0.16); }
/* hover: a soft rounded light inside the half, never a cell with square edges */
.cap-mode::before, .cap-menu::before { content: ""; position: absolute; inset: 4px; border-radius: 999px; background: rgb(255 255 255 / 0.32); opacity: 0; transition: opacity 0.2s ease; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .cap-mode:hover::before, .cap-menu:hover::before { opacity: 1; } }
/* on the disc half the light is a ring around the disc itself, centred on it */
.cap-mode::before { inset: auto; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; }
.cap-mode > *, .cap-menu > * { position: relative; }
.cap-mode:focus-visible, .cap-menu:focus-visible { outline: 2px solid var(--cap-ink); outline-offset: -3px; }
.cap-word { display: grid; }
.cap-word > span { grid-area: 1 / 1; transition: opacity 0.2s ease, transform 0.3s var(--cap-ease); }
.cap-word .w-close { opacity: 0; transform: translateY(4px); }
.cap.open .cap-word .w-open { opacity: 0; transform: translateY(-4px); }
.cap.open .cap-word .w-close { opacity: 1; transform: none; }
.cap-menu .burger { display: none; width: 16px; height: 10px; }
.cap-menu .burger i { position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform 0.3s var(--cap-ease), top 0.3s var(--cap-ease); }
.cap-menu .burger i:first-child { top: 1px; }
.cap-menu .burger i:last-child { top: 7.5px; }
.cap.open .cap-menu .burger i:first-child { top: 4.25px; transform: rotate(45deg); }
.cap.open .cap-menu .burger i:last-child { top: 4.25px; transform: rotate(-45deg); }
@media (max-width: 22.4375em) {   /* under 360px the word gives way to the two-line icon */
  .cap-word { display: none; }
  .cap-menu .burger { display: block; }
  .cap-menu { padding: 0 0.95rem 0 0.85rem; }
}

/* day/night: one circle; the sun sinks out of the bottom as the moon rises in from the top */
.cap-orb { position: relative; display: block; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgb(31 42 42 / 0.1); }
/* its sky is one tall gradient, night over dusk over day, that slides with them: the turn passes through dusk */
.cap-orb::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #15233b 0%, #2c4166 26%, #b77a78 44%, #f0b483 52%, #f6e7c4 66%, #fffaf0 100%) 50% 100% / 100% 340% no-repeat;
  transition: background-position 0.9s cubic-bezier(0.65, 0, 0.35, 1); }
.cap-orb svg { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s ease; }
.cap-orb .sun { color: #b4721c; }
.cap-orb .moon { color: #f4efe2; transform: translateY(-26px); }
html[data-mode="night"] .cap-orb::before { background-position: 50% 0%; }
html[data-mode="night"] .cap-orb .sun { transform: translateY(26px); }
html[data-mode="night"] .cap-orb .moon { transform: none; }

/* the panel: its own glass, under the capsule */
.cap .cap-panel.button {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 3; display: block; box-sizing: border-box;
  width: var(--w1, 300px); min-height: 0; padding: 12px 22px 16px; border-radius: 22px;
  white-space: normal; text-align: left; cursor: auto; color: var(--cap-ink);
  --sga: 0.9; --lift: 0px; --press: 0;
  -webkit-backdrop-filter: blur(24px) saturate(1.25); backdrop-filter: blur(24px) saturate(1.25);
  transform-origin: 100% 0; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
@media (hover: hover) { html .cap .cap-panel.button:hover { --lift: 0px; --glowa: var(--glowa-rest); --top: var(--top-rest); } }
html .cap .cap-panel.button:active { --press: 0; }
.cap.open .cap-panel.button { opacity: 1; visibility: visible; transform: none; transition: opacity 0.26s var(--cap-ease), transform 0.26s var(--cap-ease), visibility 0s; }
.cap-primary { display: flex; flex-direction: column; padding: 2px 0 12px; }
.cap-primary a { position: relative; display: flex; align-items: center; min-height: 46px; width: fit-content;
  font: 500 1.375rem/1.1 Inter, "Inter Fallback", "Helvetica Neue", Arial, system-ui, sans-serif; letter-spacing: -0.03em;
  color: var(--cap-ink); text-decoration: none; }
.cap-primary a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--cap-teal); }
.cap-secondary { display: flex; flex-wrap: wrap; gap: 0 18px; padding-top: 8px; border-top: 1px solid rgb(31 42 42 / 0); transition: border-color 0.1s ease; }
.cap.open .cap-secondary { border-top-color: rgb(31 42 42 / 0.12); transition: border-color 0.3s ease 0.1s; }
.cap-secondary a { position: relative; display: inline-flex; align-items: center; min-height: 40px;
  font: 400 0.875rem/1.2 Inter, "Inter Fallback", "Helvetica Neue", Arial, system-ui, sans-serif; letter-spacing: -0.005em;
  color: var(--cap-ink-2); text-decoration: none; }
.cap-secondary a::after { content: ""; position: absolute; inset: -2px -6px; }
.cap-panel a { opacity: 0; transform: translateY(4px); transition: opacity 0.1s ease, transform 0.1s ease, color 0.2s ease; }
.cap.open .cap-panel a { opacity: 1; transform: none; transition: opacity 0.24s ease calc(0.06s + var(--i, 0) * 30ms), transform 0.34s var(--cap-ease) calc(0.06s + var(--i, 0) * 30ms), color 0.2s ease; }
.cap.open .cap-primary a:is(:hover, :focus-visible) { transform: translateX(4px); color: var(--cap-teal); transition: transform 0.3s var(--cap-ease), color 0.2s ease; }
.cap.open .cap-secondary a:is(:hover, :focus-visible) { color: var(--cap-ink); text-decoration: underline; text-underline-offset: 3px; }
.cap-panel a:focus-visible { outline: 2px solid var(--cap-teal); outline-offset: 3px; border-radius: 4px; }
/* phones: "Get in touch" leaves the crowded header and closes the panel instead (Chris, Dec 2: "hide the get in touch in
   the menu on mobile pls. That top part is too crowded with it"); same data-write hook, so it opens the same dialog */
.cap-cta { display: none; }
@media (max-width: 47.99em) {
  :is(.hdr-right, .hh-right) > [data-write] { display: none !important; }
  .cap-cta { display: block; margin-top: 12px; }
  .cap .cap-cta .button { display: flex; width: 100%; min-height: 46px; padding: 0 1.25rem; border-radius: 999px; font-size: 0.9375rem; --sga: 0.86; }
  .cap-panel .cap-cta a:focus-visible { border-radius: 999px; }
}

/* night: the panel is dark glass in the night ground (the pills stay as they are) */
html[data-mode="night"] .cap .cap-panel.button {
  background-image: none; background-color: rgb(11 20 26 / 0.82); color: #fffaf0;
  box-shadow: inset 0 0 0 1px rgb(198 233 227 / 0.16), inset 0 1px 0 rgb(198 233 227 / 0.14), 0 30px 70px -26px rgb(0 6 12 / 0.7), 0 2px 8px rgb(0 6 12 / 0.3);
}
html[data-mode="night"] .cap-panel.button::before { opacity: 0.05; }
html[data-mode="night"] .cap-primary a { color: #fffaf0; }   /* explicit: the subpage header styles its own links */
html[data-mode="night"] .cap-secondary a { color: rgb(255 250 240 / 0.7); }
html[data-mode="night"] .cap.open .cap-secondary { border-top-color: rgb(255 250 240 / 0.14); }
html[data-mode="night"] .cap.open .cap-primary a:is(:hover, :focus-visible) { color: rgb(198 233 227); }
html[data-mode="night"] .cap.open .cap-secondary a:is(:hover, :focus-visible) { color: #fffaf0; }
html[data-mode="night"] .cap-primary a[aria-current="page"]::before { background: rgb(198 233 227); }
html[data-mode="night"] .cap-panel a:focus-visible { outline-color: rgb(198 233 227); }

@media (prefers-reduced-motion: reduce) {
  .cap .cap-panel.button, .cap.open .cap-panel.button { transform: none !important; }
  .cap-panel a, .cap.open .cap-panel a { transform: none !important; transition: opacity 0.15s ease; }
  .cap-orb svg, .cap-orb::before { transition: opacity 0.3s ease; }
  html[data-mode="night"] .cap-orb .sun { transform: none; opacity: 0; }
  .cap-orb .moon { transform: none; opacity: 0; }
  html[data-mode="night"] .cap-orb .moon { opacity: 1; }
}

/* subpages: the old house menu stays in the page for house.js, out of sight */
.hh .hh-menu, .hh-sheet { display: none !important; }
.hh .hh-right { gap: 8px !important; }
