/* ============================================================
   Chars Consulting — Base: resets, typography, layout primitives
   ============================================================ */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--urgent-h) + 12px);
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* Default inline-icon size; container-scoped rules (.btn svg, .icon-badge svg,
   .ph svg, .brand svg …) are more specific and override this. */
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: hsl(var(--foreground));
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
h4 { font-size: 1.2rem; }

p { text-wrap: pretty; }

a { color: hsl(var(--primary)); text-decoration: none; transition: color .2s ease; }
a:hover { color: hsl(var(--accent)); }

ul, ol { padding-left: 1.25rem; }

::selection { background: hsl(var(--accent) / .30); }

:focus-visible {
  outline: 3px solid hsl(var(--ring) / .55);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Layout ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--muted { background: hsl(var(--secondary) / .5); }
.section--sage { background: hsl(var(--teal-light)); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: hsl(var(--accent));
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: hsl(var(--accent));
  border-radius: 2px;
}

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow::before { display: none; }
.section-head p.lead { margin-top: .9rem; color: hsl(var(--muted-foreground)); font-size: 1.1rem; }

.lead { font-size: 1.12rem; color: hsl(var(--muted-foreground)); }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.text-accent { color: hsl(var(--accent)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

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

.skip-link {
  position: absolute; left: 1rem; top: -100px;
  background: hsl(var(--primary)); color: #fff;
  padding: .6rem 1rem; border-radius: 6px; z-index: 2000;
  transition: top .2s ease;
}
.skip-link:focus { top: calc(var(--urgent-h) + 8px); color:#fff; }

/* Prose (blog / article bodies) ----------------------------- */
.prose { max-width: 44rem; font-size: 1.12rem; line-height: 1.8; color: hsl(var(--foreground) / .92); }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 { margin-top: 2.6rem; font-size: 1.9rem; }
.prose h3 { margin-top: 2rem; }
.prose a { color: hsl(var(--accent)); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .5rem; }
.prose blockquote {
  border-left: 4px solid hsl(var(--accent));
  padding: .5rem 0 .5rem 1.4rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: hsl(var(--primary));
}
