/* ==========================================================================
   Anderson Advisory & Marketing — styles.css
   --------------------------------------------------------------------------
   1. Custom properties (tokens)
   2. Reset / base
   3. Typography
   4. Layout primitives (containers, grids)
   5. Components (buttons, cards, nav, forms)
   6. Page-specific overrides
   7. Utilities
   8. Media queries
   ========================================================================== */

/* ==========================================================================
   1. CUSTOM PROPERTIES (TOKENS)
   ========================================================================== */

:root {
  /* Color palette */
  --ink:      #0A1F44;  /* deep navy — primary headings, primary buttons */
  --charcoal: #2A2A2A;  /* body text */
  --slate:    #5A6478;  /* secondary text, captions, eyebrows */
  --bone:     #FAFAF7;  /* page background, off-white */
  --paper:    #FFFFFF;  /* cards, contrast surfaces */
  --rule:     #E5E5E0;  /* hairlines, borders */
  --accent:   #8B6F47;  /* warm bronze — single accent, used sparingly */

  /* Typography */
  --font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Type scale — desktop */
  --fs-display:  64px;
  --fs-h1:       48px;
  --fs-h2:       32px;
  --fs-h3:       24px;
  --fs-lg:       18px;
  --fs-base:     16px;
  --fs-sm:       14px;

  /* Line heights */
  --lh-display: 1.15;
  --lh-body:    1.6;

  /* Spacing — 8px base grid */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  48px;
  --space-6:  64px;
  --space-7:  96px;
  --space-8:  128px;
  --space-9:  160px;

  /* Layout */
  --max-width: 1200px;
  --text-measure: 680px;

  /* Section rhythm */
  --section-y: 128px;
}

/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Offset for sticky header when jumping to anchors */
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--charcoal);
  background-color: var(--bone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Visible focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Remove the default outline for mouse users that support :focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 600;
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

p {
  line-height: var(--lh-body);
}

p + p {
  margin-top: var(--space-3);
}

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

/* Display heading — hero H1s */
.display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
}

/* Eyebrow — small caps label above headlines */
.eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate);
  margin-bottom: var(--space-2);
}

/* Lede — introductory paragraph */
.lede {
  font-size: var(--fs-lg);
  color: var(--slate);
  line-height: var(--lh-body);
  max-width: var(--text-measure);
}

.subhead {
  font-size: 20px;
  color: var(--slate);
  line-height: var(--lh-body);
  max-width: var(--text-measure);
}

/* ==========================================================================
   4. LAYOUT PRIMITIVES
   ========================================================================== */

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

.section {
  padding-block: var(--section-y);
}

/* Hairline rules between sections rather than background shifts */
.section--ruled {
  border-top: 1px solid var(--rule);
}

.measure {
  max-width: var(--text-measure);
}

.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.section-head {
  margin-bottom: var(--space-6);
}

.section-head h2 {
  max-width: 900px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1100;
  background: var(--ink);
  color: var(--bone);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
  text-decoration: none;
}

/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 32px;
  border-radius: 2px;
  border: 1px solid transparent;
  text-align: center;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background-color: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}

.btn--primary:hover {
  background-color: #081933;
}

.btn--secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn--secondary:hover {
  background-color: var(--ink);
  color: var(--bone);
}

/* Smaller variant for header */
.btn--sm {
  padding: 10px 20px;
  font-size: 13px;
}

/* Inverted secondary for dark CTA bands */
.btn--inverted {
  background-color: transparent;
  color: var(--bone);
  border-color: var(--bone);
}

.btn--inverted:hover {
  background-color: var(--bone);
  color: var(--ink);
}

/* Text link with arrow */
.link-arrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--accent);
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bone);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

/* Hairline appears once scrolled past 40px (toggled via JS) */
.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 72px;
  padding-block: var(--space-2);
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark:hover {
  text-decoration: none;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-left: auto;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.primary-nav__link {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--charcoal);
}

.primary-nav__link:hover,
.primary-nav__link[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

.primary-nav__link[aria-current="page"] {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* --- Mobile overlay nav --------------------------------------------------- */

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background-color: var(--bone);
  padding: var(--space-3);
  flex-direction: column;
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.mobile-nav__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.mobile-nav__close svg {
  width: 24px;
  height: 24px;
}

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-6);
}

.mobile-nav__link {
  display: block;
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--ink);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--rule);
}

.mobile-nav__link:hover {
  color: var(--accent);
  text-decoration: none;
}

.mobile-nav__cta {
  margin-top: var(--space-6);
}

.mobile-nav__cta .btn {
  width: 100%;
}

/* Lock body scroll while overlay is open */
body.nav-open {
  overflow: hidden;
}

/* --- Cards ---------------------------------------------------------------- */

.card {
  background-color: var(--paper);
  border: 1px solid var(--rule);
  padding: var(--space-4);
}

/* --- Practice column (home + services) ------------------------------------ */

.practice {
  display: flex;
  flex-direction: column;
}

.practice__numeral {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.practice__name {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.practice__body {
  color: var(--charcoal);
  margin-bottom: var(--space-3);
}

.practice .link-arrow {
  margin-top: auto;
}

/* --- Numbered step list --------------------------------------------------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: baseline;
}

.step__num {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  color: var(--accent);
  line-height: 1.2;
}

.step__name {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

/* --- Pull quote ----------------------------------------------------------- */

.pull-quote {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* --- Credibility band ----------------------------------------------------- */

.credibility {
  text-align: center;
}

.credibility__label {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate);
  margin-bottom: var(--space-3);
}

.credibility__list {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  color: var(--ink);
  line-height: 1.5;
}

.credibility__list .dot {
  color: var(--accent);
  margin-inline: var(--space-1);
}

/* --- CTA band ------------------------------------------------------------- */

.cta-band {
  background-color: var(--ink);
  color: var(--bone);
  text-align: center;
}

.cta-band h2 {
  color: var(--bone);
  max-width: 720px;
  margin-inline: auto;
}

.cta-band__subhead {
  color: rgba(250, 250, 247, 0.8);
  font-size: var(--fs-lg);
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
}

/* --- Bulleted content lists ----------------------------------------------- */

.list-block {
  margin-top: var(--space-2);
}

.list-block__heading {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin-bottom: var(--space-2);
}

.bullets li {
  position: relative;
  padding-left: var(--space-3);
  margin-bottom: var(--space-1);
  line-height: var(--lh-body);
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 1px;
  background-color: var(--accent);
}

/* --- Principles ----------------------------------------------------------- */

.principle__title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

/* --- Forms ---------------------------------------------------------------- */

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

.form-field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--charcoal);
  background-color: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 12px 14px;
  transition: border-color 150ms ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #B3261E;
}

.field-error {
  display: none;
  font-size: var(--fs-sm);
  color: #B3261E;
  margin-top: var(--space-1);
}

.form-field.has-error .field-error {
  display: block;
}

.form-note {
  font-size: var(--fs-sm);
  color: var(--slate);
  margin-top: var(--space-2);
}

/* --- Contact details ------------------------------------------------------ */

.contact-details {
  margin-bottom: var(--space-5);
}

.contact-details dt {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate);
  margin-bottom: 2px;
}

.contact-details dd {
  font-size: var(--fs-lg);
  color: var(--ink);
  margin-bottom: var(--space-3);
}

.contact-details a {
  color: var(--ink);
}

.contact-details a:hover {
  color: var(--accent);
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background-color: var(--bone);
  padding-block: var(--space-7) var(--space-4);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-5);
}

.site-footer__wordmark {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: var(--space-2);
  display: inline-block;
}

.site-footer__positioning {
  color: var(--slate);
  max-width: 320px;
}

.site-footer__heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate);
  margin-bottom: var(--space-3);
}

.site-footer__list li {
  margin-bottom: var(--space-2);
}

.site-footer__list a {
  color: var(--charcoal);
}

.site-footer__list a:hover {
  color: var(--ink);
}

.site-footer__contact p {
  color: var(--charcoal);
  margin-bottom: var(--space-1);
}

.site-footer__contact a {
  color: var(--charcoal);
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-7);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-sm);
  color: var(--slate);
}

/* ==========================================================================
   6. PAGE-SPECIFIC OVERRIDES
   ========================================================================== */

/* --- Hero (home) ---------------------------------------------------------- */

.hero {
  padding-block: var(--space-8) var(--space-7);
}

.hero__inner {
  max-width: 860px;
}

.hero__subhead {
  margin-top: var(--space-4);
}

.hero__rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin-block: var(--space-5);
  max-width: 120px;
  margin-inline: 0;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* --- Approach summary (home) ---------------------------------------------- */

.approach-summary {
  align-items: start;
}

.approach-summary__quote {
  padding-right: var(--space-5);
}

/* --- Page header (inner pages) -------------------------------------------- */

.page-header {
  padding-block: var(--space-8) var(--space-6);
}

.page-header h1 {
  max-width: 900px;
}

.page-header .lede {
  margin-top: var(--space-4);
}

/* --- Deep service / phase section ----------------------------------------- */

.deep-section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--rule);
}

.deep-section__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.deep-section__numeral {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  color: var(--accent);
  line-height: 1;
}

.deep-section__name {
  font-size: var(--fs-h2);
}

.deep-section__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

.deep-section__lists {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* --- Principles grid ------------------------------------------------------ */

.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5) var(--space-6);
}

/* --- Contact layout ------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: start;
}

/* ==========================================================================
   7. UTILITIES
   ========================================================================== */

.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;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--space-3); }
.mt-5 { margin-top: var(--space-5); }

/* Scroll-fade animation (opt-in, subtle) */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */

/* Larger desktop padding */
@media (min-width: 1280px) {
  .container {
    padding-inline: var(--space-4);
  }
}

/* Tablet / below 1024px — collapse nav to hamburger */
@media (max-width: 1024px) {
  .primary-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  :root {
    --section-y: 96px;
  }

  .deep-section__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* Tablet down to phone — type scale + grid reflow */
@media (max-width: 768px) {
  :root {
    /* Mobile type scale: 40 / 32 / 24 / 20 / 17 / 16 / 13 */
    --fs-display: 40px;
    --fs-h1:      32px;
    --fs-h2:      24px;
    --fs-h3:      20px;
    --fs-lg:      17px;
    --section-y:  72px;
  }

  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }

  .approach-summary__quote {
    padding-right: 0;
    margin-bottom: var(--space-5);
  }

  .principles-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .hero {
    padding-block: var(--space-7) var(--space-6);
  }

  .page-header {
    padding-block: var(--space-7) var(--space-5);
  }

  .credibility__list {
    font-size: 20px;
  }
}

/* Small phones */
@media (max-width: 640px) {
  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Reduced motion — disable all scroll-fade animations */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
