/* ============================================================
   TRACE CHROME — the site header, footer and Request-access modal.

   One copy for every page. Requires /assets/trace-base.css for its
   tokens; load this second, then the page's own sheet.

   Companion markup, inlined at build time by build/htmlIncludes.ts:
     partials/nav.html
     partials/footer.html
     partials/access-modal.html
   Companion behaviour: /assets/trace-chrome.js
   ============================================================ */

/* ============ NAV - three-zone ============ */
.nav{
  position:sticky; top:0; z-index:60;
  background:rgba(247,247,245,0.88);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.nav__inner{
  max-width:var(--max-w); margin:0 auto; padding:0 var(--gutter);
  height:64px;
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
}
.nav__logo{ justify-self:start; display:flex; align-items:center; gap:9px; color:var(--ink); }
.nav__logo svg{ height:28px; width:auto; display:block; fill:currentColor; flex:0 0 auto; }  /* nav bar is 64px; 28px keeps the wordmark in scale with the 0.95rem links */
.nav__links{ display:flex; gap:26px; justify-self:center; }
.nav__links a{ position:relative; font-weight:600; font-size:.95rem; color:var(--ink); opacity:.85; transition:opacity .18s ease; }
.nav__links a::after{ content:""; position:absolute; left:0; bottom:-2px; width:100%; height:1.5px; background:currentColor; transform:scaleX(0); transform-origin:left center; transition:transform .22s ease; }
.nav__links a:hover{ opacity:1; }
.nav__links a[aria-current="page"]{ color:var(--teal); opacity:1; }
.nav__links a:hover::after{ transform:scaleX(1); }
.nav__right{ display:flex; gap:10px; align-items:center; justify-self:end; }
.nav__ghost{ font-weight:600; font-size:.95rem; padding:9px 14px; border-radius:var(--r-btn); transition:background .18s ease; }
.nav__ghost:hover{ background:rgba(18,18,18,0.06); }

.nav__burger{ display:none; justify-self:end; width:40px; height:40px; position:relative; }
.nav__burger span{ position:absolute; left:9px; right:9px; height:2px; background:var(--ink); border-radius:2px; transition:transform .25s ease, opacity .2s ease, top .25s ease; }
.nav__burger span:nth-child(1){ top:13px; } .nav__burger span:nth-child(2){ top:19px; } .nav__burger span:nth-child(3){ top:25px; }
.nav__burger.open span:nth-child(1){ top:19px; transform:rotate(45deg); }
.nav__burger.open span:nth-child(2){ opacity:0; }
.nav__burger.open span:nth-child(3){ top:19px; transform:rotate(-45deg); }
.nav__drawer{ display:none; }

/* ============ FOOTER ============ */
footer{ background:#121212; border-top:1px solid rgba(255,255,255,0.08); padding:48px 0 40px; }
.footer-inner{ max-width:1200px; margin:0 auto; padding:0 var(--gutter); display:flex; flex-direction:column; gap:16px; }
.footer-logo-wrap{ display:flex; }
.footer-logo-wrap svg{ height:26px; width:auto; display:block; fill:var(--cream); }
.footer-ca a, .footer-links a{ font-size:12px; color:rgba(255,255,255,0.5); text-decoration:none; font-weight:400; transition:color .2s; }
.footer-ca a:hover, .footer-links a:hover{ color:var(--mint-2); }
.footer-links{ display:flex; gap:20px; flex-wrap:wrap; }
.footer-links a[aria-current="page"]{ color:var(--mint-2); }
.footer-cb-row{ display:flex; align-items:center; gap:10px; padding-top:8px; border-top:1px solid rgba(255,255,255,0.06); flex-wrap:wrap; }
.footer-cb-logo{ display:flex; align-items:center; opacity:.7; text-decoration:none; transition:opacity .2s; }
.footer-cb-logo:hover{ opacity:1; }
.footer-cb-logo svg{ height:15px; width:auto; display:block; }
.footer-cb-text{ font-size:12px; color:rgba(255,255,255,0.3); font-weight:400; }
.footer-cb-sep{ font-size:12px; color:rgba(255,255,255,0.2); }
.footer-cb-link{ font-size:12px; color:rgba(255,255,255,0.3); text-decoration:none; transition:color .2s; }
.footer-cb-link:hover{ color:var(--mint-2); }

/* ============ REQUEST ACCESS MODAL ============
   Ported from the live page (pacehq.ai/mcp): same copy, same HubSpot form
   (portal 4716094 / form af3282d5-8cf0-40b8-96a1-1a511cc54b41).
   Retokenised to the Trace system: live used #14151B (blue-tinted dark),
   a 12px radius and a gradient submit; those become --ink-card, --r-panel
   and a solid cream button to match the dark panels elsewhere. */
.modal{
  display:none; position:fixed; inset:0; z-index:9999;
  background:rgba(0,0,0,0.7);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  align-items:center; justify-content:center; padding:20px;
}
.modal.is-open{ display:flex; }
.modal__panel{
  background:var(--ink-card); border:1px solid var(--ink-border2);
  border-radius:var(--r-panel);
  padding:clamp(26px,4vw,40px);
  width:100%; max-width:520px; position:relative;
  max-height:90vh; max-height:90svh; overflow-y:auto;
}
.modal__close{
  position:absolute; top:12px; right:12px;
  color:var(--cream-mute); font-size:22px; line-height:1; padding:6px 10px;
  border-radius:var(--r-tag); transition:color .15s ease, background .15s ease;
}
.modal__close:hover{ color:var(--cream); background:rgba(255,255,255,0.06); }
.modal__panel h2{
  font-family:var(--display); font-weight:700; font-size:1.5rem;
  color:var(--cream); letter-spacing:-0.02em; margin-bottom:10px;
}
.modal__panel > p{ font-size:.95rem; color:var(--cream-soft); margin-bottom:26px; }
.modal__fallback{ font-size:.9rem; color:var(--cream-soft); }
.modal__fallback a{ color:var(--mint-2); text-decoration:underline; text-underline-offset:3px; }

/* ---- HubSpot form skin (selectors are HubSpot's own markup) ---- */
#dp-hs-form .hs-form-private{ font-family:var(--sans); display:flex; flex-direction:column; }
#dp-hs-form label{
  display:block; font-family:var(--sans); font-size:11px; font-weight:600;
  color:var(--cream-mute); letter-spacing:.08em; text-transform:uppercase; margin-bottom:8px;
}
#dp-hs-form .hs-form-field{ margin-bottom:20px; }
#dp-hs-form .hs-input{
  width:100% !important; box-sizing:border-box;
  background:rgba(255,255,255,0.06); border:1px solid var(--ink-border2);
  border-radius:var(--r-card); padding:12px 14px;
  font-family:var(--sans); font-size:.95rem; color:var(--cream);
  outline:none; transition:border-color .15s ease;
}
#dp-hs-form .hs-input::placeholder{ color:var(--cream-mute); }
#dp-hs-form .hs-input:focus{ border-color:var(--mint); }
#dp-hs-form .hs-error-msgs{ list-style:none; padding:0; margin:6px 0 0; }
#dp-hs-form .hs-error-msgs li label{ color:#F87171; font-size:12px; text-transform:none; letter-spacing:0; }
#dp-hs-form .hs-submit{ margin-top:4px; }
#dp-hs-form .hs-button{
  width:100%; background:var(--cream); color:var(--ink);
  border:0; border-radius:var(--r-btn); padding:12px 20px;
  font-family:var(--sans); font-size:.98rem; font-weight:600; cursor:pointer;
  transition:background .18s ease, transform .18s ease;
}
#dp-hs-form .hs-button:hover{ background:#fff; transform:translateY(-1px); }
#dp-hs-form .legal-consent-container{ order:1; margin-top:14px; }
#dp-hs-form .legal-consent-container p{
  font-size:11px; color:var(--cream-mute); line-height:1.5; text-align:center; margin:0;
}
#dp-hs-form .submitted-message{ font-size:.95rem; color:var(--mint-2); text-align:center; padding:10px 0; }
#dp-hs-form .hs_recaptcha{ display:none !important; }
#dp-hs-form a{ color:var(--mint-2); }

/* visible keyboard focus everywhere in the modal */
.modal a:focus-visible, .modal button:focus-visible, .modal input:focus-visible{
  outline:2px solid var(--mint); outline-offset:2px;
}

/* ============ CHROME RESPONSIVE ============ */
@media (max-width: 720px){
  .nav__inner{ grid-template-columns:auto 1fr auto; }
  .nav__links, .nav__right{ display:none; }
  .nav__burger{ display:block; }
  .nav__drawer{
    display:flex; flex-direction:column; gap:6px;
    position:fixed; top:64px; left:0; right:0; z-index:55;
    background:var(--paper); border-bottom:1px solid var(--line);
    padding:18px var(--gutter) 24px;
    /* a percentage here resolves against the drawer's own height, which does not
       account for top:64px, so -110% left the last 30px on screen. Offset the
       height plus the top inset so it clears at any drawer height. */
    transform:translateY(calc(-100% - 72px)); transition:transform .3s cubic-bezier(.2,.6,.2,1);
  }
  .nav__drawer.open{ transform:none; }
  /* the drawer's Request-access trigger is a <button>, so it needs the same
     treatment as the links or it sits centred and unpadded next to them */
  .nav__drawer a, .nav__drawer button{ font-weight:600; padding:12px 6px; font-size:1.05rem; text-align:left; }
  .nav__drawer .primary{ background:var(--ink); color:var(--cream); border-radius:var(--r-btn); text-align:center; margin-top:8px; padding:13px; }
  .nav__drawer .ghost{ border:1.5px solid var(--ink); border-radius:var(--r-btn); text-align:center; margin-top:8px; padding:11.5px; }

  footer{ padding:40px 0; }
}
