/* Built by Gold — shared site chrome: the menu with its dropdowns, the phone menu, breadcrumbs, hub service lists, footer link list.
   Loaded after each page's own <style>, so it wins where they overlap. Tokens come from design-system.md §8 (defined on each page). */

/* ===== menu: four parents with children (Consulting has no hub page, so its parent is a <span>), About, then the CTA ===== */
.links { gap: var(--space-5); }
@media (min-width: 768px) and (max-width: 1023px) { .nav { padding: 0 var(--space-5); } .links { gap: var(--space-3); } .nav .btn-secondary { padding: var(--space-3) var(--space-4); white-space: nowrap; } }   /* six items + the CTA: tighter on tablets so nothing clips */
.links .menu { position: relative; display: flex; align-items: center; }
.links .menu > a, .links .menu > span { padding-right: 18px; }
.links .menu > span { position: relative; color: var(--bone); font-size: var(--text-sm); font-weight: 500; line-height: 1.5; cursor: default; }
.links .menu > a::before, .links .menu > span::before { content: ""; position: absolute; right: 2px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1px solid var(--stone); border-bottom: 1px solid var(--stone); transform: rotate(45deg); transition: border-color var(--dur-fast) var(--ease-out); }
.links .menu:hover > a::before, .links .menu:focus-within > a::before, .links .menu:hover > span::before, .links .menu:focus-within > span::before { border-color: var(--gold); }
.links .sub { position: absolute; top: 100%; left: calc(var(--space-4) * -1); min-width: 272px; padding: var(--space-2) 0; margin-top: -6px;
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(var(--move-sm)); pointer-events: none; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.links .menu:hover .sub, .links .menu:focus-within .sub { opacity: 1; transform: none; pointer-events: auto; }
.links .sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }      /* keeps the menu open while the pointer crosses the gap */
.links .sub a { display: block; padding: var(--space-3) var(--space-4); color: var(--bone); font-size: var(--text-sm); white-space: nowrap; }
.links .sub a:hover, .links .sub a:focus-visible { color: var(--cream); background: rgba(227,188,82,0.06); }
.links .sub a[aria-current="page"] { color: var(--gold); }
.links .sub a[aria-current="page"]::after { display: none; }
.links .sub .hub { color: var(--stone); font-family: var(--font-mono); font-size: var(--text-micro); letter-spacing: 0.12em; text-transform: uppercase; padding-bottom: var(--space-1); }
.links .sub .hub:hover { color: var(--gold); background: none; }
/* a parent is "current" when one of its children is the page */
.links .menu.is-here > a, .links .menu.is-here > span { color: var(--gold); }
.links .menu.is-here > a::after, .links .menu.is-here > span::after { content: ""; position: absolute; left: 0; right: 18px; bottom: 6px; height: 1px; background: var(--gold); }
@media (prefers-reduced-motion: reduce) { .links .sub { transition: none; } }

/* ===== phone menu: a button in the bar, the links as a full panel under it ===== */
.burger { display: none; width: 44px; height: 44px; margin-left: auto; margin-right: var(--space-2); padding: 0; border: 0; background: none; cursor: pointer; color: var(--bone); }
.burger span { display: block; width: 20px; height: 1px; margin: 0 auto; background: currentColor; transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.burger span + span { margin-top: 5px; }
.nav.open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .burger span:nth-child(2) { opacity: 0; }
.nav.open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 767px) {
  .burger { display: block; }
  .nav .btn-secondary { padding: var(--space-3) var(--space-4); }
  .nav.open .links { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    height: calc(100vh - 64px); height: calc(100svh - 64px); overflow-y: auto; -webkit-overflow-scrolling: touch; z-index: 30;
    background: var(--ink); padding: var(--space-4) var(--space-4) var(--space-8); border-top: 1px solid var(--line); }
  .nav.open .links .menu { flex-direction: column; align-items: stretch; }
  .nav.open .links .menu > a, .nav.open .links .menu > span, .nav.open .links > a { padding: var(--space-4) 0; font-family: var(--font-display); font-size: var(--text-h3); font-weight: 400; border-bottom: 1px solid var(--line); }
  .nav.open .links .menu > a::before, .nav.open .links .menu > span::before { right: 4px; width: 8px; height: 8px; }
  .nav.open .links .sub { position: static; opacity: 1; transform: none; pointer-events: auto; min-width: 0; margin: 0 0 var(--space-3); padding: var(--space-2) 0 0;
    background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; box-shadow: none; }
  .nav.open .links .sub a { padding: var(--space-3) 0 var(--space-3) var(--space-4); white-space: normal; }
  .nav.open .links a[aria-current="page"]::after, .nav.open .links .menu.is-here > a::after, .nav.open .links .menu.is-here > span::after { display: none; }
}

/* ===== breadcrumb (child pages): Home › Search › Local SEO ===== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); color: var(--stone); }
.crumbs a { color: var(--stone); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
.crumbs a:hover { color: var(--cream); }
.crumbs i { display: inline-block; width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); }
.crumbs span { color: var(--bone); }

/* ===== hub service list: one row per child page (the home page's ledger, smaller) ===== */
.svc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.svc-list li { border-bottom: 1px solid var(--line); }
.svc-list a { display: grid; grid-template-columns: 1fr 28px; gap: var(--space-2) var(--space-6); padding: var(--space-5) 0; text-decoration: none; color: inherit; align-items: start; }
@media (min-width: 1024px) { .svc-list a { grid-template-columns: 5fr 7fr 28px; } }
.svc-list h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--text-h3); line-height: 1.1; letter-spacing: -0.01em; color: var(--cream); transition: color var(--dur-fast) var(--ease-out); }
.svc-list p { margin: 0; color: var(--bone); max-width: 58ch; grid-column: 1; }
@media (min-width: 1024px) { .svc-list p { grid-column: 2; } }
.svc-list .go { grid-column: 2; grid-row: 1; width: 28px; height: 28px; justify-self: end; color: var(--gold); opacity: .6; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
@media (min-width: 1024px) { .svc-list .go { grid-column: 3; } }
.svc-list .go svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.svc-list a:hover h3 { color: var(--gold); }
.svc-list a:hover .go { opacity: 1; transform: translateX(var(--move-micro)); }
.svc-list a:focus-visible { outline: 2px solid transparent; box-shadow: var(--glow-gold); }

/* ===== footer: the service link list above the usual line ===== */
footer .cols { max-width: var(--container); margin: 0 auto var(--space-6); padding: 0 var(--space-4); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-5); }
@media (min-width: 768px) { footer .cols { grid-template-columns: repeat(4, 1fr); padding: 0 var(--space-6); } }
@media (min-width: 1280px) { footer .cols { padding: 0 var(--space-8); } }
footer .cols b { display: block; color: var(--chrome); font-weight: 500; margin-bottom: var(--space-3); }
footer .cols b a { color: var(--chrome); }
footer .cols a { display: block; padding: var(--space-1) 0; color: var(--bone); text-decoration: none; text-transform: none; font-family: var(--font-ui); font-size: var(--text-sm); letter-spacing: 0; }
footer .cols a:hover { color: var(--cream); }

/* "Start a project" in the top bar stays on one line on phones */
.nav > .btn { white-space: nowrap; }
@media (max-width: 420px) { .nav > .btn { padding: 10px 12px; font-size: 13px; } }

/* ===== phones: Higgsfield scenes play as their own band right under the menu, the words sit fully below it =====
   A 16:9 clip forced to fill a tall phone shows only ~26% of its width; this band shows ~65%.
   Nothing overlays the scene: the words start under the band on plain ink (Brett, 2026-11-12).
   Frame scenes (.chapter[data-frames]) and the Three.js stages (.stage-3d) both use it; the 3D scripts size to the canvas and centre the object in it. */
@media (max-width: 767px) {
  .chapter[data-frames] .stage-pin, .chapter .stage-3d { --nav-h: 56px; --band: min(35svh, 86vw); }
  .chapter .stage-pin.stage-3d canvas:not(#frames) { inset: var(--nav-h) 0 auto 0; height: var(--band); }
  .chapter[data-frames] .stage-pin canvas,
  .chapter[data-frames] .stage-pin > img { inset: var(--nav-h) 0 auto 0; height: var(--band); }
  .chapter[data-frames] .stage-pin::after {
    background: linear-gradient(180deg, rgba(15,13,8,0.45) 0, rgba(15,13,8,0) calc(var(--nav-h) + 24px),
      rgba(15,13,8,0) calc(var(--nav-h) + var(--band) - 28px), var(--ink) calc(var(--nav-h) + var(--band)), var(--ink) 100%); }
  .chapter[data-frames] .step, .chapter .stage-3d .step { top: calc(var(--nav-h) + var(--band) + 16px); bottom: auto; }
  /* the space under the band is ~450px on a typical phone: tighter type so every step fits without touching the scene */
  .chapter[data-frames] .step .k, .chapter .stage-3d .step .k { margin-bottom: 10px; font-size: 12px; line-height: 18px; }
  .chapter[data-frames] .step .t, .chapter .stage-3d .step .t { margin-bottom: 14px; font-size: min(var(--fs-t, 34px), 34px); }
  .chapter[data-frames] .step p, .chapter .stage-3d .step p { font-size: 15px; line-height: 1.42; margin-bottom: 12px; }
  .chapter[data-frames] .step .btn[href*="contact"], .chapter .stage-3d .step .btn[href*="contact"] { display: none; }   /* "Start a project" is always in the top bar; links to other pages stay */
}
/* short phones (iPhone SE class): a shorter band and a touch smaller paragraph so the longest steps still clear the screen */
@media (max-width: 767px) and (max-height: 720px) {
  .chapter[data-frames] .stage-pin, .chapter .stage-3d { --band: min(29svh, 86vw); }
  .chapter[data-frames] .step p, .chapter .stage-3d .step p { font-size: 14px; }
  .chapter[data-frames] .step .t, .chapter .stage-3d .step .t { font-size: 30px; }
}
