/* ==========================================================================
   Hudson Financial & Risk Solutions LLP
   base.css: reset, design tokens, typography, buttons, utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette: McLaren-derived */
  --papaya:       #FF8000;
  --papaya-deep:  #E56E00;
  /* Three tiers of papaya, chosen against the three light surfaces this site
     uses: white #FFF, bone #F6F6F3 and wash #FFF4E8. Measured, not eyeballed:
       --papaya         on white 2.52:1  -> large decoration and dark surfaces only
       --papaya-graphic on white 3.49:1, bone 3.15:1  -> icons, focus ring,
                        outline numerals (the 3:1 non-text / large-text tier)
       --papaya-ink     on white 5.28:1, bone 4.76:1, wash 4.86:1 -> body-size text
     #B35900 used to fill the ink role but measured 4.46:1 on bone and 4.45:1 on
     wash, i.e. it failed 4.5:1 on every surface except pure white. */
  --papaya-graphic: #D96A00;
  --papaya-ink:   #AA5400;   /* papaya as SMALL TEXT on light backgrounds only */
  --papaya-wash:  #FFF4E8;
  --papaya-line:  rgba(255, 128, 0, 0.28);

  --carbon:       #0A0B0C;
  --anthracite:   #1B1D1F;
  --slate:        #2C2F32;
  --graphite:     #5A5F63;
  --silver:       #A8ADB2;
  --hairline:     #E4E4E1;
  --hairline-dk:  rgba(255, 255, 255, 0.13);
  --bone:         #F6F6F3;
  --white:        #FFFFFF;

  /* Semantic */
  --bg:           var(--white);
  --ink:          var(--carbon);
  --ink-muted:    var(--graphite);
  --rule:         var(--hairline);

  /* Typography */
  --font-display: "Montserrat", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-body:    "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;

  --fs-display:   clamp(2.75rem, 6vw, 5.5rem);
  --fs-h1:        clamp(2.375rem, 4.6vw, 4rem);
  --fs-h2:        clamp(2rem, 3.6vw, 3.25rem);
  --fs-h3:        clamp(1.375rem, 1.9vw, 1.75rem);
  --fs-h4:        clamp(1.125rem, 1.35vw, 1.3125rem);
  --fs-lead:      clamp(1.0625rem, 1.3vw, 1.3125rem);
  --fs-body:      1.0625rem;
  --fs-sm:        0.9375rem;
  --fs-xs:        0.8125rem;
  --fs-eyebrow:   0.75rem;

  /* Spacing scale: the "wide spaced" system */
  --space-section: clamp(88px, 11vw, 168px);
  --space-block:   clamp(48px, 6vw, 88px);
  --gutter:        clamp(20px, 4vw, 48px);
  --grid-gap:      clamp(24px, 3vw, 56px);
  --container:     1360px;
  --container-narrow: 860px;

  /* Motion */
  --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur:       0.4s;

  --header-h:  84px;

  /* Largest width the partner photo may be rendered at. Keep this equal to the
     real pixel width of assets/img/deanna.jpg so the browser never upscales it.
     Raise it when a higher-resolution headshot is supplied (REPLACE-ME.md, 7). */
  --partner-photo-max: 400px;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-muted);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "kern" 1, "liga" 1;
}

img,
svg,
video { display: block; max-width: 100%; height: auto; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; }

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

hr { border: 0; border-top: 1px solid var(--rule); }

::selection { background: var(--papaya); color: var(--carbon); }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.display {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

h1, .h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 0.99;
  letter-spacing: -0.028em;
  text-transform: uppercase;
}

h2, .h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
}

h3, .h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.15; }
h4, .h4 { font-size: var(--fs-h4); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }

p { text-wrap: pretty; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--graphite);
  font-weight: 400;
}

/* Eyebrow: the papaya section label */
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--papaya-ink);
}

.eyebrow--on-dark { color: var(--papaya); }

/* Signature motif #1: the papaya bar */
.rule-bar {
  display: block;
  width: 56px;
  height: 3px;
  background: var(--papaya);
  border: 0;
  margin-bottom: 28px;
}

.rule-bar--center { margin-inline: auto; }

/* Signature motif #2: outline index numerals */
.index-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  /* The stroke is the only ink here, so it carries the contrast requirement:
     large text, 3:1. --papaya measured 2.52:1 on the white cards. */
  -webkit-text-stroke: 1.25px var(--papaya-graphic);
  user-select: none;
}

.on-dark .index-num,
.bg-carbon .index-num,
.page-hero .index-num,
.svc-card--dark .index-num { -webkit-text-stroke-color: var(--papaya); }

.index-num--solid {
  color: var(--papaya);
  -webkit-text-stroke: 0;
}

/* Solid outline numerals only ever appear on the dark hero blocks; if one is
   ever placed on a light surface it needs the 3:1 tier. */
.bg-white .index-num--solid,
.bg-bone .index-num--solid { color: var(--papaya-graphic); }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--papaya);
  --btn-fg: var(--carbon);
  --btn-bd: var(--papaya);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 17px 30px;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1.5px solid var(--btn-bd);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: transform;
}

.btn svg { flex: none; transition: transform var(--dur) var(--ease-out); }
.btn:hover svg { transform: translateX(5px); }

.btn:hover {
  --btn-bg: var(--papaya-deep);
  --btn-bd: var(--papaya-deep);
  transform: translateY(-2px);
}

/* Ghost on light */
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--carbon);
  --btn-bd: var(--carbon);
}
.btn--ghost:hover {
  --btn-bg: var(--carbon);
  --btn-fg: var(--white);
  --btn-bd: var(--carbon);
}

/* Ghost on dark */
.btn--ghost-dark {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  --btn-bd: rgba(255, 255, 255, 0.4);
}
.btn--ghost-dark:hover {
  --btn-bg: var(--white);
  --btn-fg: var(--carbon);
  --btn-bd: var(--white);
}

.btn--sm { padding: 13px 22px; font-size: 0.75rem; }
.btn--block { display: flex; width: 100%; justify-content: center; }

/* Text link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--papaya-ink);
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--papaya-line);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.link-arrow svg { flex: none; transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover { border-bottom-color: var(--papaya); }
.link-arrow:hover svg { transform: translateX(5px); }

.link-arrow--on-dark { color: var(--papaya); }

/* --------------------------------------------------------------------------
   5. Focus & accessibility
   -------------------------------------------------------------------------- */
/* The ring must clear 3:1 against whatever sits next to it. --papaya managed
   only 2.52:1 on white and 2.27:1 on bone, so the ring was effectively invisible
   on every light page; --papaya-graphic gives 3.49:1 / 3.15:1 and still 5.6:1 on
   carbon. The offset keeps the page background on both sides of the ring, so a
   papaya button underneath cannot become the adjacent color. */
:focus-visible {
  outline: 3px solid var(--papaya-graphic);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 999;
  background: var(--carbon);
  color: var(--white);
  padding: 14px 22px;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   6. Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }
.container--mid { max-width: 1120px; }

.section { padding-block: var(--space-section); }
.section--tight { padding-block: var(--space-block); }
.section--top-0 { padding-top: 0; }
.section--bottom-0 { padding-bottom: 0; }

.bg-bone { background: var(--bone); }
.bg-carbon { background: var(--carbon); }
.bg-white { background: var(--white); }

/* Dark surface inversion.
   .hero / .page-hero / .cta-band paint --carbon through a plain `background`
   declaration instead of carrying .bg-carbon, so they were outside this group
   and any heading inside them fell back to --ink on near-black. They are listed
   explicitly so a heading dropped into a hero inverts like everywhere else. */
.bg-carbon,
.on-dark,
.page-hero,
.cta-band {
  color: var(--silver);
}
.bg-carbon h1, .bg-carbon h2, .bg-carbon h3, .bg-carbon h4,
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4,
.hero h1, .hero h2, .hero h3, .hero h4,
.page-hero h1, .page-hero h2, .page-hero h3, .page-hero h4,
.cta-band h1, .cta-band h2, .cta-band h3, .cta-band h4 { color: var(--white); }
.bg-carbon .lead, .on-dark .lead,
.page-hero .lead, .cta-band .lead { color: var(--silver); }
.bg-carbon hr, .on-dark hr,
.page-hero hr, .cta-band hr { border-top-color: var(--hairline-dk); }

.text-center { text-align: center; }
.text-papaya { color: var(--papaya-ink); }
.on-dark .text-papaya, .bg-carbon .text-papaya { color: var(--papaya); }

.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-56 { margin-top: 56px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.max-60ch { max-width: 60ch; }
.max-72ch { max-width: 72ch; }

.stack > * + * { margin-top: 20px; }

/* --------------------------------------------------------------------------
   7. Section headers
   -------------------------------------------------------------------------- */
.section-head { margin-bottom: var(--space-block); }

.section-head__title { margin-top: 18px; max-width: 20ch; }
.section-head__intro { margin-top: 24px; max-width: 60ch; }

.section-head--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.section-head--center .section-head__title,
.section-head--center .section-head__intro { max-width: 24ch; }
.section-head--center .section-head__intro { max-width: 62ch; }

.section-head--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: end;
}
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1.1fr 0.9fr; gap: var(--grid-gap); }
  .section-head--split .section-head__intro { margin-top: 0; padding-bottom: 6px; }
}

/* --------------------------------------------------------------------------
   8. Scroll reveal
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
