/* SAGE Analytics — site styles
   Brand colours come from the logo. To change the signature colour,
   edit --bark below; everything dark on the site uses it. */
:root {
  --bark: #361112;      /* SAGE signature dark */
  --bark-2: #47191A;    /* slightly lifted signature dark, for panels */
  --umber: #652717;     /* deep end of the SAGE wordmark gradient */
  --ochre: #C89233;     /* owl gold, edges */
  --gold: #E3C35A;      /* owl gold, highlight */
  --ink: #2A1415;       /* body text */
  --muted: #6E5052;     /* secondary text on light */
  --line: #E6DCCB;      /* rules and borders on light */
  --tint: #FAF6EE;      /* dispute resolution background */
  --paper: #FFFFFF;
  --on-dark: #F3E9DA;   /* text on bark */
  --on-dark-muted: #D2B8AA;

  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 9vw, 120px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--umber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--bark);
}
h2 { font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: 0.01em; }
h3 { font-size: 1.375rem; font-weight: 500; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--bark); color: var(--on-dark); padding: 8px 14px; z-index: 100;
}
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 76px;
}
.brand img { width: 150px; }
.site-header nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(16px, 3vw, 36px); align-items: center;
}
.site-header nav a {
  font-family: var(--sans); font-size: 1rem; font-weight: 400;
  color: var(--bark); text-decoration: none; letter-spacing: 0.02em;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-header nav a:hover { border-bottom-color: var(--ochre); }
.site-header nav a.nav-contact {
  border: 1.5px solid var(--bark); border-radius: 999px; padding: 6px 18px;
}
.site-header nav a.nav-contact:hover { background: var(--bark); color: var(--on-dark); }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 13px 28px; border-radius: 999px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn-gold { background: var(--gold); color: var(--bark); }
.btn-gold:hover { background: #EDD27E; }
.btn-ghost { color: var(--on-dark); border-color: rgba(243, 233, 218, 0.45); }
.btn-ghost:hover { border-color: var(--on-dark); background: rgba(243, 233, 218, 0.08); }

/* Hero — a sunlit mountain trail under the signature dark.
   The photo sits behind the text; the gradient keeps the text readable
   on the left and lets the trail show on the right. */
.hero {
  background-color: var(--bark);
  background-image:
    linear-gradient(90deg, rgba(54, 17, 18, 0.94) 0%, rgba(54, 17, 18, 0.86) 38%, rgba(54, 17, 18, 0.35) 68%, rgba(54, 17, 18, 0.1) 100%),
    url("assets/hero-trail.jpg");
  background-size: cover;
  background-position: 70% center;
  color: var(--on-dark);
  overflow: hidden;
}
.hero-inner {
  display: flex; align-items: center;
  min-height: clamp(480px, 64vh, 640px);
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: clamp(56px, 8vw, 104px);
}
.hero-text { max-width: 40rem; }
.hero-tagline {
  font-style: italic; font-size: 1.15rem; color: var(--gold);
  margin: 0 0 14px;
}
.hero h1 {
  font-weight: 300;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--on-dark);
  margin-bottom: 0;
  text-wrap: balance;
}
.hero-lead { font-size: clamp(1.125rem, 1.6vw, 1.3rem); max-width: 34em; color: var(--on-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 40px; }
.hero-credit {
  font-size: 0.95rem; color: var(--on-dark-muted); max-width: 36em;
  border-top: 1px solid rgba(227, 195, 90, 0.3); padding-top: 18px; margin: 0;
}

/* Sections */
.section { padding: var(--section) 0; }
.section-tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 56px); }
.lead { font-size: 1.25rem; color: var(--ink); max-width: 40em; }

/* Governance */
.tools {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 64px);
}
.tool { border-top: 3px solid var(--ochre); padding-top: 24px; }
.tool h3 { font-size: 1.5rem; }
.tool-tagline { font-style: italic; color: var(--muted); }
.mark { font-size: 0.6em; vertical-align: super; margin-left: 1px; }

.quote {
  margin: clamp(48px, 7vw, 88px) 0;
  padding-left: clamp(20px, 3vw, 32px);
  border-left: 3px solid var(--gold);
  max-width: 46rem;
}
.quote blockquote { margin: 0; }
.quote p {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.3; color: var(--bark); margin-bottom: 14px;
}
.quote figcaption { color: var(--muted); font-size: 1rem; }

.services h3 { margin-bottom: 24px; }
.service-groups {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3.5vw, 44px);
}
.service-group { min-width: 0; border-top: 3px solid var(--ochre); padding-top: 18px; }
.service-group h4 {
  font-family: var(--sans); font-size: 1.25rem; font-weight: 500; line-height: 1.2;
  color: var(--bark); margin: 0 0 10px;
}
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li {
  padding: 7px 0 7px 20px; font-size: 1.02rem; line-height: 1.4;
  position: relative;
}
.service-list li::before {
  content: ""; position: absolute; left: 2px; top: calc(7px + 0.7em - 3.5px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--ochre);
}

/* Dispute resolution */
.dr-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(36px, 6vw, 80px); align-items: start;
}
.dr-types { margin: 32px 0; display: grid; gap: 20px; }
.dr-types dt { font-family: var(--sans); font-weight: 500; font-size: 1.2rem; color: var(--bark); }
.dr-types dd { margin: 4px 0 0; }
.areas-title { font-size: 1.125rem; margin-top: 8px; }
.areas { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.areas li {
  font-family: var(--sans); font-size: 0.98rem;
  padding: 6px 16px; border: 1px solid var(--ochre); border-radius: 999px; color: var(--bark); background: var(--paper);
}
.clause {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: clamp(24px, 3.5vw, 40px);
}
.clause h4 {
  font-family: var(--sans); font-size: 1.1rem; font-weight: 500; color: var(--bark);
  margin: 26px 0 0;
}
.clause blockquote {
  margin: 20px 0; padding: 0 0 0 20px; border-left: 3px solid var(--gold);
  font-style: italic; color: var(--ink);
}
.clause blockquote p { margin: 0; }
.clause-source { font-size: 0.95rem; color: var(--muted); margin: 0; }

/* Contact */
.section-dark { background: var(--bark); color: var(--on-dark); }
.section-dark h2, .section-dark h3 { color: var(--on-dark); }
.section-dark .lead { color: var(--on-dark); }
.section-dark a { color: var(--gold); }
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 80px); align-items: start;
}
.person {
  display: flex; align-items: center; gap: 22px;
  margin-top: 28px;
}
.person img {
  width: 132px; flex: none; border-radius: 6px;
  border: 2px solid rgba(227, 195, 90, 0.55);
}
.person-text { min-width: 0; }
.person-text p { margin: 0; }
.person-name { font-family: var(--sans); font-size: 1.35rem; font-weight: 500; color: var(--on-dark); line-height: 1.2; }
.person-text .person-creds { font-family: var(--sans); font-size: 0.98rem; color: var(--gold); letter-spacing: 0.02em; margin-top: 4px; }
.person-role { font-size: 1rem; color: var(--on-dark-muted); }
.person-text .linkedin { display: inline-block; margin-top: 10px; font-size: 1rem; }

.notice {
  margin-top: 40px; padding: 20px 22px;
  border: 1px solid rgba(227, 195, 90, 0.35); border-radius: 6px;
  font-size: 0.98rem; color: var(--on-dark-muted);
}
.notice h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--gold); }
.notice p { margin: 0; }

.contact-form {
  background: var(--bark-2); border-radius: 8px;
  padding: clamp(22px, 3.5vw, 40px);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--sans); font-size: 1rem; margin-bottom: 6px; color: var(--on-dark);
}
.opt { color: var(--on-dark-muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: #FFFDF9; border: 1.5px solid transparent; border-radius: 6px;
  padding: 11px 14px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 195, 90, 0.35);
}
.field [aria-invalid="true"] { border-color: #E79A7E; }
.hp { position: absolute; left: -9999px; }
.contact-form .cf-turnstile { margin: 4px 0 16px; min-height: 65px; }
.contact-form .btn { width: 100%; margin-top: 4px; }
.contact-form .btn[disabled] { opacity: .7; cursor: progress; }
.form-status { margin: 14px 0 0; min-height: 1.6em; font-size: 1rem; }
.form-status.ok { color: var(--gold); }
.form-status.err { color: #F2B39C; }

/* Footer */
.site-footer { background: #290C0D; color: var(--on-dark-muted); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; gap: 14px; }
.footer-inner img { width: 28px; }
.footer-inner p { margin: 0; font-size: 0.95rem; }
.footer-inner { flex-wrap: wrap; }
.footer-inner .proudly { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.footer-inner .proudly img { width: 24px; height: 12px; border-radius: 1px; }

/* Articles and resources */
.topics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}
.topic { border-top: 3px solid var(--ochre); padding-top: 22px; }
.topic h3 {
  font-size: 0.92rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--umber); margin-bottom: 6px;
}
.topic-note { font-size: 1rem; font-style: italic; color: var(--muted); margin-bottom: 18px; }
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { padding: 16px 0; border-top: 1px solid var(--line); }
.article-title {
  font-family: var(--sans); font-size: 1.2rem; font-weight: 500; line-height: 1.3;
  color: var(--bark); text-decoration: none;
}
.article-title:hover { text-decoration: underline; color: var(--umber); }
.article-meta {
  font-family: var(--sans); font-size: 0.9rem; letter-spacing: 0.02em;
  color: var(--muted); margin: 4px 0 6px;
}
.article-list p:last-child { font-size: 1rem; margin: 0; }
.resources {
  margin-top: clamp(48px, 6vw, 72px);
  background: var(--tint); border: 1px solid var(--line); border-radius: 6px;
  padding: clamp(22px, 3.5vw, 36px);
}
.resources h3 { margin-bottom: 14px; }
.resource-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 36px;
}
.resource-list a { font-family: var(--sans); font-weight: 500; }
.resource-list p { font-size: 0.98rem; color: var(--muted); margin: 4px 0 0; }
@media (max-width: 900px) {
  .topics, .resource-list { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .site-header nav a { white-space: nowrap; }
  .nav-extra { display: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .dr-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero {
    background-image:
      linear-gradient(180deg, rgba(54, 17, 18, 0.72) 0%, rgba(54, 17, 18, 0.88) 55%, rgba(54, 17, 18, 0.95) 100%),
      url("assets/hero-trail.jpg");
    background-position: 75% center;
  }
  .hero-inner { min-height: 0; }
  .service-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
}
/* Menu button: only shown on phones */
.menu-toggle { display: none; }

@media (max-width: 640px) {
  .header-inner { min-height: 64px; position: relative; }
  .brand img { width: 120px; }
  html { scroll-padding-top: 80px; }

  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-size: 1rem; color: var(--bark);
    background: none; border: 1.5px solid var(--bark); border-radius: 999px;
    padding: 8px 16px; cursor: pointer;
  }
  .menu-icon { display: grid; gap: 4px; width: 18px; }
  .menu-icon span {
    display: block; height: 2px; background: currentColor; border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
  }
  .menu-toggle[aria-expanded="true"] { background: var(--bark); color: var(--on-dark); }
  .menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .js .site-header nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(54, 17, 18, 0.12);
  }
  .js .site-header nav.open { display: block; }
  .site-header nav ul {
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px max(var(--gutter), env(safe-area-inset-right, 0px)) 16px max(var(--gutter), env(safe-area-inset-left, 0px));
  }
  .site-header nav li { border-top: 1px solid var(--line); }
  .site-header nav li:first-child { border-top: 0; }
  .site-header nav a,
  .site-header nav a.nav-contact {
    display: block; padding: 14px 0; font-size: 1.1rem;
    border: 0; border-radius: 0;
  }
  .site-header nav a:hover,
  .site-header nav a.nav-contact:hover { background: none; color: var(--umber); }

  .tools { grid-template-columns: 1fr; }
  .service-groups { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .menu-icon span { transition: none; }
}
