/* ==========================================================================
   Aldercape CSS (strand-variable driven)
   Table of Contents
   01) Root / Resets / Base
   02) Layout (containers, sections, grid)
   03) Typography
   04) Header / Navigation
   05) Buttons
   06) HERO (component)
   07) ServiceCard (component)
   08) CTA (component)
   09) Prose (markdown content)
   10) Split Content Sections (legacy)
   11) Footer
   12) Strand Theming (consulting / craftworks)
   ========================================================================== */


/* ============== 01) Root / Resets / Base ================================= */

:root {
  /* Spacing */
  --space-xs: .35rem;
  --space-sm: .65rem;
  --space-md: 1rem;
  --space-lg: 1.75rem;
  --space-xl: 3rem;

  /* Neutral palette */
  --color-text-primary: #2E2E2E;
  --color-text-secondary: #444444;
  --color-border: #E0E0E0;
  --color-bg-default: #FAFAFA;
  --color-bg-alt: #f7f9fb;
  --color-bg-light: #ffffff;
  --color-bg-invert: #222222;
  --color-text-invert: #ffffff;

  /* Generic action fallbacks (used when no strand is set) */
  --color-action: #2E2E2E;
  --color-action-contrast: #ffffff;
  --color-action-outline: #2E2E2E;

  /* Strand palettes (used to *set* strand-scoped vars later) */
    /* Default strand (generic pages) */
  --strand-primary: var(--color-text-primary);
  --strand-accent:  var(--color-border);
  --strand-bg:      var(--color-bg-default);


  --consulting-primary: #008080;   /* teal */
  --consulting-accent:  #2D6FFF;   /* electric blue */
  --consulting-bg:      #f6fafc;

  --craftworks-primary: #C1543F;   /* terracotta */
  --craftworks-accent:  #567568;   /* alder green */
  --craftworks-bg:      #fcf7f5;

  /* Components */
  --radius-card: 14px;
  --shadow-card: 0 8px 22px rgba(0,0,0,.06);
  --shadow-card-hover: 0 12px 28px rgba(0,0,0,.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--color-text-primary);
  background: var(--color-bg-default);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 2px; }

hr {
  border: none;
  height: 1px;
  margin: var(--space-lg) auto;
  background: var(--strand-accent);
  opacity: .3;
  max-width: 760px;
}
:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ============== 02) Layout (containers, sections, grid) ================== */

.container         { max-width: 1140px; margin: 0 auto; padding: 0 var(--space-md); }
.container--wide   { max-width: 1280px; }
.container--narrow { max-width: 780px; }

section { padding: var(--space-xl) 0; }
section + section { margin-top: 0; }

section.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.grid { display: grid; gap: var(--space-lg); }
.grid--2-col { grid-template-columns: 1fr; }
.grid--3-col { grid-template-columns: 1fr; }

@media (min-width: 760px)  { .grid--2-col { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .grid--3-col {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
    grid-auto-rows: 1fr;
  }
  .grid--3-col > * {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }
}


/* ============== 03) Typography =========================================== */

h1, h2, h3, h4 { margin: 0 0 .5rem 0; line-height: 1.2; }
h1 { font-family: Poppins, Inter, system-ui, sans-serif; font-weight: 800; }

section > header { margin-bottom: var(--space-lg); text-align: center; }
section > header > h2 { margin: 0 0 .5rem; }
section > header > p { margin: 0 auto; max-width: 56ch; color: var(--color-text-secondary); }


/* ============== 04) Header / Navigation ================================== */

.header { position: sticky; top: 0; z-index: 50; background: var(--color-bg-light); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem var(--space-md);
}
.nav__menu { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.nav__link { display: inline-block; padding: .35rem .5rem; text-decoration: none; }
.nav__link:hover { color: var(--strand-primary, var(--color-action)); }
.nav__link:focus-visible { outline-color: var(--strand-primary, var(--color-action)); }

/* Logo styling */
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 32px; width: auto; }


/* ============== 05) Buttons ============================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1rem; border-radius: 10px; border: 1px solid transparent;
  text-decoration: none; font-weight: 600; cursor: pointer;
  transition: filter .12s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }

/* Use strand vars if present; fall back to generic action colors */
.btn--primary {
  background: var(--strand-primary, var(--color-action));
  color: var(--color-action-contrast);
  border-color: var(--strand-primary, var(--color-action));
}
/* Hover: prefer strand accent if available, else gentle filter */
.btn--primary:hover {
  background: var(--strand-accent, var(--strand-primary, var(--color-action)));
  filter: var(--strand-accent) ? none : brightness(.95);
}

.btn--secondary {
  background: var(--color-bg-light);
  color: var(--strand-primary, var(--color-action));
  border-color: var(--strand-primary, var(--color-action-outline));
}
.btn--secondary:hover {
  background: var(--strand-primary, var(--color-bg-light));
  color: var(--color-text-invert);
  filter: var(--strand-primary) ? none : brightness(.98);
}


/* ============== 06) HERO (component) ===================================== */

.hero {
  background: linear-gradient(
    135deg,
    var(--strand-bg, var(--color-bg-alt)) 0%,
    var(--color-bg-light) 100%
  );
  padding: clamp(3rem, 5vw, 6rem) 0;
  text-align: center;
  margin-bottom: var(--space-lg);
}
.hero.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(3rem, 5vw, 6rem) var(--space-md);
}

.hero > header > h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
  font-weight: 800;
  line-height: 1.15;
}
.hero > header > p {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  margin: 0 auto var(--space-md);
  color: var(--color-text-secondary);
  max-width: 60ch;
  line-height: 1.6;
}
.hero > header > p.hero__manifesto {
  margin: .75rem auto 0;
  opacity: .85;
  font-style: italic;
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 50ch;
  line-height: 1.5;
}
.hero > nav {
  display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap;
  margin-top: var(--space-md);
}
.hero > nav .btn { min-width: 160px; }


/* ============== 07) ServiceCard (component) ============================== */

.card {
  display: block;
  background: var(--color-bg-light);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.25rem 1.4rem;
  box-shadow: var(--shadow-card);
  border-top: 6px solid var(--strand-primary, transparent);
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  height: 100%;
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
a.card:active { transform: translateY(-1px); }
a.card:focus-visible { outline: 3px solid var(--color-text-primary); outline-offset: 2px; }

.card > header > h3,
.card h3.card__title { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.card > section,
.card p.card__content { margin: 0; color: var(--color-text-primary); line-height: 1.65; }

/* Card grid (UL or DIV) */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.card-grid > li { margin: 0; }
@media (min-width: 700px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }


/* ============== 08) CTA (component) ====================================== */

.cta { padding: var(--space-xl) 0; }
.cta > header { text-align: center; }
.cta > header > h2 { margin: 0 0 .5rem; }
.cta > header > p { margin: 0 auto 1.25rem; max-width: 60ch; color: var(--color-text-secondary); }
.cta > nav { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Section action rows (if you inline buttons inside a section) */
section > nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: var(--space-lg); }


/* ============== 09) Prose (markdown content) ============================= */

.prose {
  max-width: 75ch;
  margin: 0 auto;
  padding: var(--space-xl) 0;
  text-align: center;
}
.prose p {
  max-width: 70ch;
  margin: 0 auto var(--space-md);
  color: var(--color-text-secondary);
  line-height: 1.75;
}
.prose h1, .prose h2, .prose h3 {
  color: var(--strand-primary, var(--color-text-primary));
  font-weight: 700;
}
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.25rem); margin-bottom: var(--space-lg); font-weight: 800; }
.prose h2 { font-size: 1.25rem; font-weight: 700; margin: var(--space-lg) 0 var(--space-sm); }
.prose h3 { font-size: 1.15rem; margin: var(--space-md) 0 var(--space-xs); }
.prose ul { margin: 0 0 var(--space-md); padding-left: 1.15rem; text-align: left; }
.prose li { margin: .25rem 0; list-style: none;   text-align: center;}

/* Plain list (no bullets) */
.prose .list--plain {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}
.prose .list--plain li { margin: .35rem 0; }

/* Dash list (—) */
.prose .list--dash {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}
.prose .list--dash li {
  position: relative;
  padding-left: 1.25rem;
  margin: .35rem 0;
}
.prose .list--dash li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--strand-primary, var(--color-text-secondary));
  opacity: .9;
}

/* Check list (✓), strand-tinted */
.prose .list--check {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}
.prose .list--check li {
  position: relative;
  padding-left: 1.4rem;
  margin: .4rem 0;
}
.prose .list--check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--strand-primary, var(--color-action));
}


/* ============== 10) Split Content Sections (legacy) ====================== */

.content-sections { margin-top: var(--space-xl); text-align: center; }
.content-section { background: var(--color-bg-light); padding: var(--space-xl) 0; }
.content-section:nth-child(even) { background: var(--color-bg-default); }
.content-section h2 { text-align: center; margin-bottom: var(--space-lg); }
.content-section h3 { margin-bottom: var(--space-sm); margin-top: var(--space-md); font-size: 1.5rem; }
.content-section h3:first-of-type { margin-top: 0; }
.content-section p { margin: 0 auto var(--space-md); line-height: 1.75; max-width: 750px; color: var(--color-text-secondary); }
.content-section ul { margin-bottom: var(--space-md); padding-left: var(--space-md); }
.content-section li { margin-bottom: var(--space-xs); }
.rule { height: 1px; background: var(--color-border); margin: var(--space-md) auto; max-width: 760px; }


/* ============== 11) Footer ============================================== */

footer {
  background: var(--color-bg-invert);
  color: var(--color-text-invert);
  padding: var(--space-lg) 0 var(--space-sm);
}
footer .container {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-xl); flex-wrap: wrap;
}
footer .brand { min-width: 260px; flex: 1 1 280px; }
footer .footer__logo { max-width: 280px; height: auto; display: block; filter: brightness(0) invert(1); }
footer .brand p { font-size: .9rem; margin-top: -1.2rem; color: var(--color-text-invert); opacity: .8; line-height: 1.4; }

footer .links {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 2rem;
  flex: 2 1 520px;
}
@media (max-width: 880px) { .site-footer .links { grid-template-columns: repeat(2, minmax(160px, 1fr)); } }
@media (max-width: 560px) { .site-footer .links { grid-template-columns: 1fr; } }

footer .links h4 { margin: 0 0 .5rem 0; font-size: 1rem; font-weight: 700; color: var(--color-text-invert); }
footer .links ul { list-style: none; margin: 0; padding: 0; }
footer .links li { margin: .35rem 0; }
footer .links a { text-decoration: none; color: var(--color-text-invert); opacity: .9; }
footer .links a:hover { text-decoration: underline; opacity: 1; }
footer .links a:focus-visible { outline: 2px solid var(--color-border); outline-offset: 2px; }

footer .copyright {
  margin-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  padding-top: var(--space-sm);
  opacity: .85;
}

/* Optional subtle strand tint in footer headings */
.consulting footer .links h4 { color: var(--strand-accent, var(--color-text-invert)); }
.craftworks footer .links h4 { color: var(--strand-accent, var(--color-text-invert)); }


/* ============== 12) Strand Theming (consulting / craftworks) ============= */
/* Apply these to <body> or a wrapping <section> to theme descendants.       */

.consulting {
  --strand-primary: var(--consulting-primary);
  --strand-accent:  var(--consulting-accent);
  --strand-bg:      var(--consulting-bg);
}
.craftworks {
  --strand-primary: var(--craftworks-primary);
  --strand-accent:  var(--craftworks-accent);
  --strand-bg:      var(--craftworks-bg);
}

/* Optional: tint section backgrounds when the class sits on the section */
section.consulting,
section.craftworks { background: var(--strand-bg); }