/* chrome.css: the header, the hero with the docking logo, and the footer strip.
   Needs system/tokens.css and system/base.css. Markup: components/partials/*.html.

   Page contract
   - <html class="has-hero"> on a page that opens with the hero. Other pages get the paper header.
   - An inline script in <head> adds class "js" to <html> before first paint (see demo.html).
     Without it everything here is the no-JavaScript presentation: paper header, static logo,
     nav as a plain list. */

:root{
  /* The logo. Laid out at hero size and scaled DOWN to dock, so it is never scaled up. */
  --logo-big:min(80vw,clamp(280px,34vw,520px));   /* over the hero video */
  --logo-dock:calc(var(--logo-big) * .76);        /* in the header: 76% of its hero size */
  --dock-top:10px;
  --head-h:calc(var(--logo-dock) * .3212 + 20px); /* logo is 495x159 */
  --logo-y:max(calc(var(--head-h) + 28px),19svh); /* where the big logo sits in the hero */
  --rule-band:#77787a;                            /* hairlines on the black band */
}
/* lets the scribble grey fade with the letters instead of snapping */
@property --logo-o{syntax:"<color>"; inherits:true; initial-value:#545c57}

/* ================= header ================= */
/* Default: docked. Paper, dark logo, in the flow and sticky, so inner pages need no top padding. */
.hdr{position:sticky; top:0; z-index:30; height:var(--head-h); color:var(--ink)}
.hdr-bg{position:absolute; inset:0; background:var(--paper) var(--grain); border-bottom:var(--lw-line) solid var(--graphite)}
.hdr-in{position:relative; height:100%; display:flex; align-items:center; justify-content:flex-end;
  max-width:calc(var(--maxw) + var(--frame) * 2); margin:0 auto; padding:0 calc(var(--frame) + var(--pad))}
.hdr-logo{position:absolute; z-index:1; left:calc(var(--frame) + var(--pad)); top:var(--dock-top); display:block;
  width:var(--logo-dock); margin-left:calc(var(--logo-dock) * -.04); transform-origin:0 0;
  color:var(--ink); transition:color .2s linear, --logo-o .2s linear}
.hdr-logo img,.hdr-logo svg{display:block; width:100%; height:auto}
.hdr-logo svg{overflow:visible}
/* with script the drawn logo replaces the <img>: do not flash the finished one first */
.js .hdr-logo img{visibility:hidden}

.hdr-nav ul{display:flex; flex-wrap:wrap; gap:0 22px}
.hdr-nav a{display:block; padding:10px 0; font-size:19px; line-height:1.2; text-decoration:none; transition:color .2s linear}
.hdr-nav a:hover,.hdr-nav a[aria-current="page"]{text-decoration:underline; text-decoration-thickness:2px}
.hdr-btn{position:relative; z-index:3; font:600 18px/1 var(--font-body); background:none; border:2px solid currentColor; color:inherit;
  padding:11px 14px; min-height:44px; min-width:44px; cursor:pointer; border-radius:2px; transition:color .2s linear}

@media (min-width:1160px){
  .hdr-btn{display:none}
  .hdr-nav ul{justify-content:flex-end; flex-wrap:nowrap; gap:0 clamp(16px,1.7vw,28px)}
}
@media (max-width:1159px){
  /* with script: a menu that drops from the header */
  .js .hdr-nav{position:absolute; z-index:2; left:0; right:0; top:100%; max-height:calc(100vh - var(--head-h)); max-height:calc(100svh - var(--head-h)); overflow:auto;
    color:var(--ink); background:var(--paper) var(--grain); border-bottom:var(--lw-line) solid var(--graphite);
    padding:0 calc(var(--frame) + var(--pad)) 18px}
  .js .hdr-nav:not([data-open]){display:none}
  .js .hdr-nav ul{display:block}
  .js .hdr-nav a{font:500 clamp(34px,9vw,44px)/1.05 var(--font-display); padding:11px 0; border-top:1px solid var(--hair)}
  .js .hdr-nav li:first-child a{border-top:0}
  /* without script: the header is an ordinary block, logo then links */
  html:not(.js) .hdr{position:relative; height:auto}
  html:not(.js) .hdr-in{display:block; height:auto; padding-top:var(--dock-top); padding-bottom:6px}
  html:not(.js) .hdr-logo{position:static}
  html:not(.js) .hdr-btn{display:none}
  html:not(.js) .hdr-nav ul{gap:0 18px}
}

/* Over the hero (script only): fixed, clear, white. hero.js drives the logo transform and the paper. */
.js.has-hero .hdr{position:fixed; left:0; right:0}
.js.has-hero .hdr-bg{opacity:0}
.js.has-hero .hdr-logo{width:var(--logo-big); margin-left:0; will-change:transform;
  transform:translate3d(calc(var(--logo-big) * -.04),calc(var(--logo-y) - var(--dock-top)),0)}
.js.has-hero .hdr:not([data-docked]){color:#fff}
.js.has-hero .hdr:not([data-docked]) .hdr-logo{color:#fff; --logo-o:#dcdcd7}
.js.has-hero .hdr:not([data-docked]) :focus-visible{outline-color:#fff}
/* an open menu is a sheet of paper over the whole screen, whatever is behind it: the logo turns
   dark with it, so it must never be left sitting on the video */
.js .hdr[data-menu-open] .hdr-bg{opacity:1!important; bottom:auto; height:100vh; height:100lvh; border-bottom:0}
.js.has-hero .hdr[data-menu-open]{color:var(--ink)}
.js.has-hero .hdr[data-menu-open] .hdr-logo{color:var(--ink); --logo-o:#545c57}
.js.has-hero .hdr[data-menu-open] :focus-visible{outline-color:currentColor}

/* ================= hero ================= */
/* One screen of video with the words on it, plus a tail the height of the header. The tail is what
   lets the paper header wait: it finishes fading in just as the paper arrives under it. */
.hero{position:relative; min-height:calc(100vh + var(--head-h)); min-height:calc(100svh + var(--head-h)); color:#fff; background:#000; overflow:hidden}
.hero-media,.hero-media img,.hero-media video,.hero-scrim{position:absolute; inset:0; width:100%; height:100%}
.hero-media img,.hero-media video{object-fit:cover; max-width:none}
.hero-scrim{background:linear-gradient(180deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.2) 34%,rgba(0,0,0,.22) 52%,rgba(0,0,0,.72) 100%)}
.hero-in{position:relative; min-height:100vh; min-height:100svh; display:flex; flex-direction:column;
  max-width:calc(var(--maxw) + var(--frame) * 2); margin:0 auto; padding:0 calc(var(--frame) + var(--pad))}
.hero-slot{flex:none; margin-top:var(--logo-y); width:var(--logo-big); aspect-ratio:495/159}
html:not(.js) .hero-slot{display:none}
.hero-text{margin-top:auto; padding:var(--sp-4) 0 var(--sp-5)}
.hero h1{font-size:clamp(36px,4.4vw,66px); line-height:.96; max-width:13em}
/* the enquiry walkthrough, on the video under the h1 (Joel 2026-11-21): white on the dark scrim.
   The h1, then the questions under it, on the left (Joel 2026-11-21). */
.hero-walk{margin-top:var(--sp-3); max-width:40em; padding:16px 18px 20px; border-radius:4px;
  background:rgba(0,0,0,.34); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px)}
html:not(.js) .hero-walk{background:none; padding:0; backdrop-filter:none}
.hero-walk .walk-progress,.hero-walk .walk-help,.hero-walk .small{color:rgba(255,255,255,.82)}
.hero-walk .walk-opt{border-color:rgba(255,255,255,.7); background:rgba(0,0,0,.18)}
.hero-walk .walk-opt:hover{border-color:#fff}
.hero-walk .walk-opt:has(input:checked){background:#fff; border-color:#fff; color:#000}
.hero-walk .walk-opt:has(input:focus-visible){outline-color:#fff}
.hero-walk .walk-field input,.hero-walk .walk-field textarea{border-color:rgba(255,255,255,.7); background:rgba(0,0,0,.25)}
.hero-walk .start{background:#fff; color:#000}
.hero-walk .start:hover{background:#dcdcd7}
.hero-walk .walk-thanks{border-top-color:rgba(255,255,255,.7)}
.hero-walk .walk-nojs{border-top-color:rgba(255,255,255,.7)}
.hero :focus-visible{outline-color:#fff}
@media (prefers-reduced-motion:reduce){
  .hero video{display:none}   /* the poster is the hero */
}

/* ================= footer: one slim strip =================
   The practice's name, address, email and phone (exact: they are the NAP local search reads), the way
   to the areas, the two legal pages and the site credit. One line on a wide screen, a few short lines
   on a phone. Each item is a flex item with its separator in the padding in front of it. The line is
   pulled left by one separator's width and that strip is clipped, so a separator that starts a line
   is never seen; an item that wraps (the street address on a phone) wraps inside its own box. */
.ftr{margin:0 var(--frame) var(--frame); padding:20px 0 22px}
.ftr-in{max-width:var(--maxw); margin:0 auto; padding:0 var(--pad)}
.ftr-line{--sep:.95em; display:flex; flex-wrap:wrap; margin-left:calc(var(--sep) * -1);
  clip-path:inset(-8px -8px -8px var(--sep)); font:500 18px/1.6 var(--font-display); letter-spacing:.01em; color:var(--chalk-soft)}
.ftr-nap{display:contents; font-style:normal}
.ftr-i{position:relative; min-width:0; padding-left:var(--sep)}
.ftr-i::before{content:"\00b7"; position:absolute; left:0; width:var(--sep); text-align:center; color:var(--chalk-2)}
.ftr-legal{white-space:nowrap}   /* Privacy and Terms stay together */
.ftr-line a{color:var(--chalk); display:inline-block; padding:2px 0}
.ftr .nap-name{color:var(--chalk)}
