/* ==========================================================================
   CJ Schmid Advisory — design system
   Brand: navy #0D244B, orange #D37641, Montserrat
   Target: WCAG 2.2 AA, Core Web Vitals pass
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand */
  --navy:        #0D244B;
  --navy-deep:   #081A38;
  --navy-mid:    #1C3A6B;
  --orange:      #D37641;   /* brand accent — large text, rules, icons only */
  --orange-aa:   #AD5828;   /* accessible variant — small text and fills behind white text */
  --orange-soft: #F5E4D8;

  /* Neutrals */
  --ink:      #3D4A5C;   /* body copy — 9.0:1 on white */
  --muted:    #5C6B7E;   /* secondary copy — 5.4:1 on white */
  --border:   #DFE5EC;
  --tint:     #F5F7FA;
  --white:    #FFFFFF;

  /* Fluid type scale, 1.25 ratio from an 18px base */
  --step--1: clamp(0.875rem, 0.85rem + 0.12vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.20vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.34vw, 1.406rem);
  --step-2:  clamp(1.4rem, 1.28rem + 0.6vw, 1.758rem);
  --step-3:  clamp(1.65rem, 1.42rem + 1.05vw, 2.197rem);
  --step-4:  clamp(1.95rem, 1.55rem + 1.85vw, 2.747rem);
  --step-5:  clamp(2.3rem, 1.68rem + 2.9vw, 3.433rem);

  /* 8px spacing scale */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;
  --s-8: 8rem;

  /* Layout */
  --measure: 68ch;
  --wrap: 1200px;
  --wrap-narrow: 860px;
  --radius: 4px;
  --header-h: 72px;

  --shadow-sm: 0 1px 2px rgba(13, 36, 75, 0.06), 0 2px 8px rgba(13, 36, 75, 0.05);
  --shadow-md: 0 4px 12px rgba(13, 36, 75, 0.08), 0 12px 28px rgba(13, 36, 75, 0.07);
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-2));
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 var(--s-2);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-weight: 600; }

p, ul, ol { margin: 0 0 var(--s-3); }
p { max-width: var(--measure); text-wrap: pretty; }

a { color: var(--navy-mid); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange-aa); }

img, svg { max-width: 100%; height: auto; display: block; }

strong { font-weight: 600; color: var(--navy); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-5) 0;
}

/* Visible, high-contrast focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--orange-aa);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--s-2);
  top: -100px;
  z-index: 200;
  background: var(--navy);
  color: var(--white);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--s-2); color: var(--white); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-3);
}

.wrap--narrow { max-width: var(--wrap-narrow); }

section { padding-block: var(--s-7); }
section.tight { padding-block: var(--s-6); }

.section-tint { background: var(--tint); }
.section-navy {
  background: var(--navy);
  color: #E4EAF2;
}
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy a { color: var(--white); }

.eyebrow {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-aa);
  margin: 0 0 var(--s-2);
  display: block;
}
.section-navy .eyebrow { color: var(--orange); }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
}
.section-navy .lede { color: #E4EAF2; }

.rule {
  width: 56px;
  height: 3px;
  background: var(--orange);
  border: 0;
  margin: 0 0 var(--s-3);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font: inherit;
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1;
  padding: 0.9em 1.6em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  min-height: 44px; /* WCAG 2.2 target size */
}

.btn--primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn--primary:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: var(--white);
}

.btn--accent {
  background: var(--orange-aa);
  color: var(--white);
  border-color: var(--orange-aa);
}
.btn--accent:hover { background: #964C22; border-color: #964C22; color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--ghost:hover { background: var(--navy); color: var(--white); }

.section-navy .btn--ghost { color: var(--white); border-color: rgba(255,255,255,0.6); }
.section-navy .btn--ghost:hover { background: var(--white); color: var(--navy); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  color: var(--navy-mid);
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
}
.link-arrow:hover { color: var(--orange-aa); }
.link-arrow::after { content: "\2192"; transition: transform 0.15s ease; }
.link-arrow:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   5. Header and navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}
/* Horizontal lockup. Source detail is only 128px wide, so on a high density
   screen this will be slightly soft. Replace with an SVG or a 2x export when
   available. */
.brand img { height: 38px; width: auto; }
@media (max-width: 420px) {
  .brand img { height: 32px; }
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  color: var(--navy);
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  display: block;
}
.nav__list a:hover,
.nav__list a[aria-current="page"] { border-bottom-color: var(--orange); color: var(--navy); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-2) var(--s-3) var(--s-3);
    box-shadow: var(--shadow-md);
  }
  .nav[hidden] { display: none; }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .nav__list a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav .btn { margin-top: var(--s-2); justify-content: center; }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: var(--s-8) var(--s-7);
  background:
    linear-gradient(180deg, var(--tint) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(211, 118, 65, 0.10) 0%, rgba(211, 118, 65, 0) 70%);
  pointer-events: none;
}

/* Sized so the headline holds a single line on a desktop viewport. It will still
   wrap on narrow screens, which is correct. */
.hero h1 {
  max-width: none;
  font-size: clamp(1.85rem, 1.05rem + 2.6vw, 2.7rem);
  margin-bottom: var(--s-3);
  text-wrap: nowrap;
}
@media (max-width: 1100px) {
  .hero h1 { text-wrap: balance; }
}
.hero .lede { font-size: var(--step-1); }

/* Company list on the results band */
.companies {
  list-style: none;
  padding: 0;
  margin: var(--s-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
}
.companies li {
  color: #C7D3E2;
  font-weight: 600;
  font-size: 1rem;
}

/* Second level page hero — shorter than the home page hero */
.page-hero {
  padding-block: var(--s-7) var(--s-5);
  background: linear-gradient(180deg, var(--tint) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { max-width: 20ch; margin-bottom: var(--s-3); }

.breadcrumb {
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--s-3);
}
.breadcrumb a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.breadcrumb a:hover { color: var(--orange-aa); }
.breadcrumb span { margin-inline: 0.5em; }

/* Deliverables and fit lists */
.ticks { list-style: none; padding: 0; margin: 0 0 var(--s-3); }
.ticks li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.6em;
  max-width: var(--measure);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--orange);
  border-radius: 1px;
}

.fit {
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  background: var(--white);
  padding: var(--s-3);
}
.fit h3 { font-size: var(--step-1); margin-bottom: var(--s-2); }
.fit ul { margin-bottom: 0; padding-left: 1.1em; }
.fit li { margin-bottom: 0.5em; color: var(--muted); }

.related {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
  margin-top: var(--s-5);
}
.related ul {
  list-style: none;
  padding: 0;
  margin: var(--s-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* --------------------------------------------------------------------------
   7. Cards and grids
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Always two across on desktop, one on narrow screens. Explicit rather than
   auto-fit, which was resolving to three columns at 1200px. */
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--orange);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-3) var(--s-3);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { font-size: var(--step-1); margin-bottom: var(--s-2); }
.card p { font-size: 1rem; color: var(--muted); flex-grow: 1; }
.card .link-arrow { align-self: flex-start; margin-top: var(--s-1); }

/* Numbered approach steps */
.step {
  border-left: 3px solid var(--border);
  padding-left: var(--s-3);
}
.step__num {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-aa);
  display: block;
  margin-bottom: var(--s-1);
}
.step h3 { font-size: var(--step-1); margin-bottom: var(--s-1); }
.step p { font-size: 1rem; color: var(--muted); margin-bottom: 0; }

/* Stat blocks */
.stat { padding-block: var(--s-2); }
.stat__value {
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  display: block;
  margin-bottom: var(--s-1);
  letter-spacing: -0.02em;
}
.stat__label {
  font-size: 0.95rem;
  color: #B9C6D8;
  margin: 0;
  max-width: 28ch;
}

/* Engagement list */
.engagements { list-style: none; padding: 0; margin: var(--s-5) 0 0; }
.engagements li {
  border-top: 1px solid var(--border);
  padding-block: var(--s-3);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: var(--s-3);
  align-items: start;
}
.engagements li:last-child { border-bottom: 1px solid var(--border); }
.engagements h3 {
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.engagements p { margin: 0; color: var(--muted); font-size: 1rem; }

@media (max-width: 700px) {
  .engagements li { grid-template-columns: 1fr; gap: var(--s-1); }
}

/* Two column prose split */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--s-5);
  align-items: start;
}

/* --------------------------------------------------------------------------
   8. Contact form
   -------------------------------------------------------------------------- */

.form { margin-top: var(--s-4); max-width: 620px; }

.field { margin-bottom: var(--s-3); }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #7C8CA0;
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  min-height: 44px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--navy); }

.form__note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: var(--s-2);
}

.contact-aside {
  border-left: 3px solid var(--orange);
  padding-left: var(--s-3);
}
.contact-aside p { font-size: 1rem; }

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--navy-deep);
  color: #B9C6D8;
  padding-block: var(--s-5) var(--s-4);
  font-size: 0.95rem;
}
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer h4 {
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  font-size: 0.875rem;
  color: #93A4BA;
}
.site-footer__legal p { margin: 0; max-width: none; }
