/* ==========================================================================
   base.css — fonts, reset, document defaults, accessibility primitives
   Loaded second, after tokens.css.
   ========================================================================== */

/* ---- Self-hosted fonts ---------------------------------------------------
   woff2 first with woff as a fallback for older browsers. font-display:swap
   means copy is readable immediately and reflows once the face arrives, which
   matters here: a proposal is often opened on a phone on a slow connection.

   Sharp Sans Medium covers weights 400-500 in one file (variable range), so
   there is no separate Regular.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Sharp Sans';
  src: url('../fonts/SharpSans-Medium.woff2') format('woff2'),
       url('../fonts/SharpSans-Medium.woff') format('woff');
  font-weight: 400 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sharp Sans';
  src: url('../fonts/SharpSans-MediumItalic.woff2') format('woff2'),
       url('../fonts/SharpSans-MediumItalic.woff') format('woff');
  font-weight: 400 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Sharp Sans';
  src: url('../fonts/SharpSans-Semibold.woff2') format('woff2'),
       url('../fonts/SharpSans-Semibold.woff') format('woff');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sharp Sans';
  src: url('../fonts/SharpSans-Bold.woff2') format('woff2'),
       url('../fonts/SharpSans-Bold.woff') format('woff');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sharp Grotesk';
  src: url('../fonts/SharpGrotesk-Medium23.woff2') format('woff2'),
       url('../fonts/SharpGrotesk-Medium23.woff') format('woff');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sharp Grotesk';
  src: url('../fonts/SharpGrotesk-SemiBold23.woff2') format('woff2'),
       url('../fonts/SharpGrotesk-SemiBold23.woff') format('woff');
  font-weight: 600 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Pitch Sans';
  src: url('../fonts/pitch-sans-bold.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* ---- Reset --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Stops the fixed header covering a section when a nav tab is clicked. */
  scroll-padding-top: var(--hr-scroll-pad);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--hr-paper);
  color: var(--hr-ink);
  font-family: var(--hr-font-sans);
  font-size: var(--hr-text-md);
  line-height: var(--hr-leading-loose);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The comp set margins per element inline. Zero them once and let the
   section styles put them back deliberately. */
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

/* Form controls inherit the page font rather than the OS font. */
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
textarea { resize: vertical; }

/* ---- Links ---------------------------------------------------------------
   The comp's signature link behaviour: a hairline underline that sits close
   and drops away from the text on hover, rather than a colour change.        */

a {
  color: var(--hr-magenta-ink);
  text-decoration: none;
  text-decoration-thickness: 1px;
  /* Colour only. The comp also pushed text-underline-offset from 3px to 5px
     on hover, which made the underline visibly drop a couple of pixels under
     the cursor — the link looked like it shifted. The underline going from
     faint to full colour is the effect worth keeping; the movement isn't. */
  transition: text-decoration-color var(--hr-dur-slow) var(--hr-ease);
}

/* Body links carry a visible underline; navigation and button-like links
   opt out with .hr-link-plain. */
.hr-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hr-link-underline);
}
.hr-link:hover { text-decoration-color: var(--hr-magenta-ink); }

/* Same link on a dark section. */
.hr-link--dark { color: var(--hr-pink); text-decoration-color: var(--hr-link-underline-dark); }
.hr-link--dark:hover { text-decoration-color: var(--hr-pink); }

.hr-link-plain, .hr-link-plain:hover { text-decoration: none; }

/* ---- Focus ---------------------------------------------------------------
   Keyboard focus must be obvious everywhere. :focus-visible keeps it off
   mouse clicks. Form controls get a tighter inset ring so the outline doesn't
   sit awkwardly outside a rounded input.                                     */

:focus-visible {
  outline: 2px solid var(--hr-magenta);
  outline-offset: 2px;
  border-radius: 4px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline-width: 1px;
  outline-offset: -1px;
  border-color: var(--hr-magenta);
}
/* On ink backgrounds the magenta ring only just clears the 3:1 a focus
   indicator needs (3.04:1 on the savings cards). Pink gives 6.5-8.5:1, so
   every dark region switches to it. */
.hr-cover :focus-visible,
.hr-section--ink :focus-visible,
.hr-total :focus-visible,
.hr-save :focus-visible,
.hr-startdate :focus-visible,
.hr-rush :focus-visible,
.hr-sticky :focus-visible,
.hr-due :focus-visible,
.hr-on-dark :focus-visible { outline-color: var(--hr-pink); }

/* ---- Accessibility helpers ----------------------------------------------- */

/* The `hidden` attribute has to win.
   --------------------------------------------------------------------------
   Browsers implement `hidden` as a user-agent rule, `[hidden] { display: none }`
   — and ANY author declaration beats a UA one regardless of specificity. So a
   plain component rule like `.hr-ticklist__item { display: flex }` silently
   overrode it, and elements marked hidden stayed on screen. That is what broke
   "Show more": the extra deliverables carried the attribute, were reported as
   hidden by script, and rendered anyway.

   !important is the right tool here and one of the few places it belongs:
   `hidden` is a statement that the element is not relevant, and no layout rule
   should be able to argue with it. Everything that hides via the attribute —
   the deliverables, the accept bars, the Accept panel, proposal-only blocks on
   an estimate — depends on this one line. */
[hidden] { display: none !important; }

/* Visible only to screen readers. */
.hr-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Skip link: hidden until focused, then pinned to the top-left. */
.hr-skip {
  position: absolute; left: 12px; top: -80px; z-index: calc(var(--hr-z-dialog) + 1);
  background: var(--hr-ink); color: var(--hr-white);
  font-size: var(--hr-text-md); font-weight: 600;
  padding: 12px 18px; border-radius: var(--hr-r-md);
  transition: top var(--hr-dur-fast) var(--hr-ease-mech);
}
.hr-skip:focus { top: 12px; }

/* Stops the page scrolling behind the open Accept panel. */
.hr-no-scroll { overflow: hidden; }

/* ---- Motion --------------------------------------------------------------
   Keyframes used across the page. Section files reference them by name.      */

@keyframes hr-slide-in  { from { transform: translateX(28px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes hr-slide-out { from { transform: none; opacity: 1 } to { transform: translateX(28px); opacity: 0 } }
@keyframes hr-fade-up  { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes hr-bob      { 0%, 100% { transform: translateY(0); opacity: .85 } 50% { transform: translateY(7px); opacity: 1 } }
@keyframes hr-pulse    { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 59, 118, .5) } 70% { box-shadow: 0 0 0 16px rgba(201, 59, 118, 0) } }

/* Scroll reveal. Elements start shifted and blurred; ui.js removes
   .hr-reveal as each one enters the viewport.

   IMPORTANT: the class is only ever added by JavaScript, so with JS off
   nothing is hidden. Never put .hr-reveal in the HTML. */
.hr-reveal { opacity: 0; transform: translateY(22px) scale(.994); filter: blur(4.5px); }
/* For a block too tall to reduce further: fade without the rise, since part
   of it is already on screen when it starts and any movement would lurch. */
.hr-reveal.hr-reveal--fade { transform: none; }
.hr-reveal-on {
  /* --hr-ease-draw, not --hr-ease. The latter is an expo-out that reaches its
     final value at about 16% of the duration, so a "1.15s" fade was really
     over in ~200ms and spent the rest of the time stationary — you'd scroll
     to a block and find it had already finished. This curve spends its time
     actually moving. */
  transition: opacity 1s var(--hr-ease-draw),
              transform 1s var(--hr-ease-draw),
              filter 1s var(--hr-ease-draw);
  will-change: opacity, transform, filter;
}
.hr-reveal-done { will-change: auto; }

/* One switch for every animation on the page. ui.js checks the same query
   before it starts the cover intro, the reveal observer or the quote
   rotation, so reduced motion means genuinely no motion, not fast motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hr-reveal { opacity: 1; transform: none; filter: none; }
}

/* ---- Print ---------------------------------------------------------------
   Clients do print proposals. Drop the fixed furniture, open every panel and
   let the content flow. */
@media print {
  .hr-header, .hr-sticky, .hr-mobile-bar, .hr-float-accept,
  .hr-devbar, .hr-scroll-cue, .hr-accept-backdrop { display: none !important; }
  body { background: #fff; }
  .hr-collapse { display: block !important; }
  .hr-collapse__inner { overflow: visible !important; }
  .hr-faq__panel { display: block !important; grid-template-rows: 1fr !important; }
  .hr-section { padding: 24px 0 !important; break-inside: avoid; }
}
