/* Zone Theta — site navigation. LOCKED (2026-10-08): change only when the owner asks.
   Recreates Cohere's navigation with Zone Theta's categories.
   Measured from cohere.com (2026-10-08) and matched here:
   - Link: gradient underline grows in on hover (300ms) — owner change 2026-10-08, replaced
     Cohere's pill + text roll so every link matches
   - Drawer: height opens via grid rows 0fr→1fr (300ms, .4,0,.2,1); every item
     runs fadeInDownDrawer (opacity 0, translateY(-25%) → 0) for 500ms ease-in-out
   - Drawer items dim to 50% on hover (150ms)
   - Primary button: solid pill, darkens on hover (300ms); a blurred gradient glow
     behind it slides from (-6px, 6px) to (-8px, 8px) and fades in (500ms)
   - Secondary text link: gradient underline grows from 0 to full width (300ms)
   - Phone menu: wipes down with clip-path (500ms); links rise 20px with a 50ms
     stagger (500ms ease-out); the two buttons slide in from the right (300ms, 30ms stagger) */

:root {
  --nav-h: 72px;
  --nav-pill: color-mix(in oklab, var(--ink) 6%, var(--paper));
  --nav-muted: color-mix(in oklab, var(--ink) 58%, var(--paper));
  --solid: var(--plum);
  --solid-hover: color-mix(in oklab, var(--plum) 72%, black);
  --glow-a: #b49ad8;   /* soft plum, from the logo */
  --glow-b: #d9a07c;   /* warm clay, from the logo's taupe */
  --ease-tw: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-tw-out: cubic-bezier(0, 0, 0.2, 1);
}

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; }

.bar {
  position: relative; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  display: flex; align-items: center;
  height: var(--nav-h); margin-inline: 40px;
}
.brand { display: block; flex: none; }
.brand img { height: 44px; width: auto; }

/* Links: the gradient underline grows in on hover/focus and stays while open or current (300ms) */
.links { display: flex; align-items: center; gap: 4px; margin: 0 0 0 40px; padding: 0; list-style: none; }
.nav-link {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 6px 12px; border: 0;
  background: transparent; cursor: pointer;
  font-size: 0.875rem; line-height: 1.4; color: var(--ink); text-decoration: none;
}
.nav-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 1px;
  background: linear-gradient(to right, var(--glow-b), var(--glow-a), var(--plum));
  transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease-tw);
}
.item:hover .nav-link::after, .nav-link:focus-visible::after,
.nav-link[aria-expanded="true"]::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link:focus-visible { outline: none; }
/* Services has sub-pages: a small chevron says so, and turns while the drawer is open */
.nav-link .chev { width: 10px; height: 10px; margin-left: 6px; transition: transform 300ms var(--ease-tw); }
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* Behind the open drawer the page dims and softens, so the drawer is the only thing in focus
   (Cohere does the same: black 20% + backdrop blur, 300ms) */
.nav-scrim {
  position: fixed; inset: 0; z-index: 38;
  background: rgb(20 16 22 / 0.2);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 300ms var(--ease-tw), visibility 0s 300ms;
}
.nav-scrim.is-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 300ms var(--ease-tw), visibility 0s; }

/* Right side */
.actions { display: flex; align-items: center; margin-left: auto; }
.text-link {
  position: relative; display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 6px 0; font-size: 0.875rem; line-height: 1.4; color: var(--ink); text-decoration: none;
}
.text-link::after {
  content: ""; height: 1px; width: 100%; margin-top: 2px;
  background: linear-gradient(to right, var(--glow-b), var(--glow-a), var(--plum));
  transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease-tw);
}
.text-link:hover::after, .text-link:focus-visible::after { transform: scaleX(1); }

.btn-solid {
  position: relative; /* no z-index, so the glow can sit behind the button */
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px;
  border: 2px solid transparent; border-radius: 9999px;
  background: var(--solid); color: var(--paper);
  font-size: 0.875rem; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 300ms, color 300ms;
}
.btn-solid::before {
  content: ""; position: absolute; top: 0; left: 0; z-index: -1;
  width: 100%; height: 100%; border-radius: 32px;
  background: linear-gradient(270deg, var(--glow-a), var(--glow-b));
  filter: blur(8px); opacity: 0;
  transform: translate(-6px, 6px);
  backface-visibility: hidden; will-change: transform, filter, opacity;
  transition: transform 500ms var(--ease-tw), filter 500ms var(--ease-tw), opacity 500ms var(--ease-tw);
}
.btn-solid:hover, .btn-solid:focus-visible { background: var(--solid-hover); }
.btn-solid:hover::before, .btn-solid:focus-visible::before { opacity: 1; transform: translate(-8px, 8px); }
.btn-solid:focus-visible { outline: none; border-color: var(--paper); box-shadow: 0 0 0 2px var(--plum); }

/* Drawer */
.drawer-wrap {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 300ms var(--ease-tw);
}
.drawer-wrap.is-open { grid-template-rows: 1fr; }
.drawer-clip { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s 300ms; }
.drawer-wrap.is-open .drawer-clip { visibility: visible; transition: visibility 0s; }
.drawer { background: var(--paper); border-bottom: 1px solid var(--line); }
.drawer-inner { display: flex; margin-left: 40px; padding-right: 40px; }
.cols { display: flex; }
.col { display: flex; flex-direction: column; width: 272px; flex: none; padding: 24px 24px 32px; }
.col:first-child { padding-left: 0; }
.col-label { margin: 0 0 24px; font-size: 0.75rem; font-weight: 500; line-height: 1.4; color: var(--nav-muted); }
.col ul { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.d-link { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.d-link .t, .d-link .s { transition: opacity 150ms var(--ease-tw); }
.d-link:hover .t, .d-link:hover .s, .d-link:focus-visible .t { opacity: 0.5; }
.d-link .t { font-size: 0.875rem; line-height: 1.4; }
.d-link .s { font-size: 0.75rem; line-height: 1.4; color: var(--nav-muted); }
.d-link.lead .t { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.3; }
/* Areas of Focus while its page is archived (owner, 2026-11-01): shown as it was, but plain text, not a link */
.d-link.is-static { cursor: default; }
.d-link.is-static:hover .t, .d-link.is-static:hover .s { opacity: 1; }

.featured { display: flex; align-self: stretch; margin-left: auto; padding-right: 40px; margin-right: -40px; background: var(--paper-deep); }
.featured .col { width: 352px; padding-left: 24px; }
.featured .col-label { color: color-mix(in oklab, var(--ink) 85%, var(--paper)); font-weight: 400; }
.feature-card { display: block; text-decoration: none; color: var(--ink); }
.feature-card .image-slot { aspect-ratio: 16 / 9; border-radius: 4px; background: color-mix(in oklab, var(--ink) 7%, var(--paper-deep)); }
.feature-card .image-slot::after { content: ""; }
.feature-card .feature-photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 55% 22%; border-radius: 4px; background: color-mix(in oklab, var(--ink) 7%, var(--paper-deep)); }
.feature-card p { margin: 16px 0 0; font-size: 0.875rem; line-height: 1.4; transition: opacity 150ms var(--ease-tw); }
.feature-card:hover p { opacity: 0.5; }
.arrow { display: inline-block; margin-left: 4px; }

/* Items drop in each time the drawer opens */
@keyframes fadeInDownDrawer { 0% { opacity: 0; transform: translateY(-25%); } 100% { opacity: 1; transform: translateY(0); } }
.drawer[data-animated="true"] .drop { opacity: 0; animation: fadeInDownDrawer 0.5s ease-in-out forwards; }

/* ---------- Phone ---------- */
.burger { display: none; margin-left: auto; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; place-items: center; }
.burger svg { width: 24px; height: 24px; }
.burger .i-close { display: none; }
.burger[aria-expanded="true"] .i-open { display: none; }
.burger[aria-expanded="true"] .i-close { display: block; }

.m-panel {
  position: fixed; left: 0; right: 0; bottom: 0; top: var(--nav-h); z-index: 39;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper);
  clip-path: inset(0 0 100% 0); pointer-events: none; visibility: hidden;
  transition: clip-path 500ms var(--ease-tw), visibility 0s 500ms;
}
.m-panel.is-open { clip-path: inset(0); pointer-events: auto; visibility: visible; transition: clip-path 500ms var(--ease-tw), visibility 0s; }
.m-view { flex: 1; overflow-y: auto; padding: 24px 20px; }
.m-view[hidden] { display: none; }
.m-list { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.m-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px;
  padding: 6px 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--font-text); font-size: 1.5rem; line-height: 1.25; color: var(--ink); text-decoration: none;
}
.m-link svg { width: 16px; height: 16px; color: var(--nav-muted); }
.rise { opacity: 0; transform: translateY(20px); transition: opacity 500ms var(--ease-tw-out), transform 500ms var(--ease-tw-out); }
.slide { opacity: 0; transform: translateX(20px); transition: opacity 300ms var(--ease-tw-out), transform 300ms var(--ease-tw-out); }
.m-panel[data-nav-animated="true"] .rise, .m-panel[data-nav-animated="true"] .slide { opacity: 1; transform: none; }

.m-back {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 52px; padding: 0 20px;
  border: 0; background: var(--nav-pill); cursor: pointer; font-size: 1rem; color: var(--ink); text-align: left;
}
.m-back svg { width: 14px; height: 14px; }
.m-sub .col-label { margin: 0 0 16px; }
.m-sub ul { display: flex; flex-direction: column; gap: 20px; margin: 0 0 28px; padding: 0; list-style: none; }
.m-sub .d-link .t { font-size: 1rem; }
.m-sub .d-link.lead .t { font-size: 1.25rem; }
.m-sub hr { height: 1px; margin: 0 0 20px; border: 0; background: var(--line); }

.m-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.m-foot .btn-solid { width: 100%; height: 48px; padding: 0 20px; font-size: 0.9375rem; }

@media (max-width: 1023px) {
  :root { --nav-h: 64px; }
  .bar-inner { margin-inline: 20px; }
  .brand img { height: 38px; }
  .links, .actions, .drawer-wrap, .nav-scrim { display: none; }
  .burger { display: grid; }
}
@media (min-width: 1024px) { .m-panel { display: none; } }
@media (min-width: 1024px) and (max-width: 1279px) {
  .col { width: 232px; }
  .featured .col { width: 300px; }
}

body.is-locked { overflow: hidden; }

/* Reduced motion: no drop-in, no wipe */
@media (prefers-reduced-motion: reduce) {
  .drawer[data-animated="true"] .drop { animation: none; opacity: 1; }
  .rise, .slide { opacity: 1; transform: none; }
}


/* ---------- Tab form (locked 2026-10-08) ----------
   The bar hangs from the top edge as a see-through paper tab with rounded bottom corners,
   so it sits on the hero film instead of above it (after Telepathic Instruments).
   Used by adding .is-tab to the header (partials/nav.html does). */
.nav.is-tab { left: 50%; right: auto; width: min(1240px, calc(100% - 48px)); transform: translateX(-50%); }
.nav.is-tab .bar {
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 0; border-radius: 0 0 24px 24px;
  transition: border-radius 200ms ease, background-color 300ms ease;
}
.nav.is-tab .bar-inner { margin-inline: 28px; }
.nav.is-tab:has(.drawer-wrap.is-open) .bar { border-radius: 0; background: var(--paper); }
.nav.is-tab .drawer-clip { border-radius: 0 0 24px 24px; }
.nav.is-tab .drawer-inner { margin-left: 28px; padding-right: 28px; }
.nav.is-tab .featured { margin-right: -28px; padding-right: 28px; }
@media (max-width: 1023px) {
  .nav.is-tab { width: calc(100% - 24px); }
  .nav.is-tab .bar-inner { margin-inline: 16px; }
  /* While the phone menu is open the tab becomes the full-width solid bar the menu hangs from */
  .nav.is-tab:has([data-burger][aria-expanded="true"]) { width: 100%; }
  .nav.is-tab:has([data-burger][aria-expanded="true"]) .bar { border-radius: 0; background: var(--paper); }
  .nav.is-tab:has([data-burger][aria-expanded="true"]) .bar-inner { margin-inline: 20px; }
}

/* Content starts below the fixed bar. A full-bleed hero can opt out with .under-nav */
main { padding-top: var(--nav-h); }
main.under-nav { padding-top: 0; }

/* ---------- Steps aside for the footer (owner request 2026-10-08) ----------
   As the footer card arrives, the tab slides up out of view so the page ends with one paper
   shape and one booking button; js/nav.js adds .is-away. It comes back as soon as you scroll up
   or tab into it, and never hides while the drawer or phone menu is open. */
.nav.is-tab { transition: transform 500ms var(--ease-out); }
.nav.is-tab.is-away { transform: translate(-50%, calc(-100% - 16px)); }
