/* ==========================================================================
   CarnelianPearls Tech - shared stylesheet
   One file for the whole site. Mobile-first. British English.
   Sections:
     1.  Design tokens
     2.  Reset and base
     3.  Typography
     4.  Layout primitives
     5.  Skip link and focus
     6.  Header and navigation
     7.  Buttons
     8.  Hero
     9.  Section intros and generic sections
     10. Cards (doorways)
     11. Steps (how we work)
     12. In focus / Taska block
     13. Audience strip
     14. Lists (page content)
     15. Closing CTA band
     16. Footer
     17. Contact page and forms
     18. Legal pages
     19. Utilities and reduced motion
     20. Responsive breakpoints
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  --ink:            #1A1714; /* near-black text */
  --muted:          #6B645C; /* secondary text */
  --bg:             #FBFAF7; /* warm off-white base */
  --surface:        #FFFFFF; /* cards */
  --line:           #E7E2D9; /* hairline borders */
  --carnelian:      #B7410E; /* primary accent, warm red-orange */
  --carnelian-dark: #92330B; /* hover / active */
  --pearl:          #F4F1EA; /* soft fill for alt sections */

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --maxw: 1180px;        /* max content width */
  --maxw-text: 70ch;     /* comfortable reading measure */
  --pad: clamp(1.25rem, 5vw, 2.5rem);          /* side padding */
  --section-y: clamp(3rem, 8vw, 6rem);         /* vertical rhythm */
  --radius: 10px;
  --header-h: 64px;
}

/* 2. Reset and base ------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem); /* 16 to 18px */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--carnelian); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--carnelian-dark); }

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

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* 3. Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }

.lead {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem);
  color: var(--muted);
  max-width: var(--maxw-text);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--carnelian);
  margin: 0 0 0.75rem;
}

/* 4. Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

main { display: block; }

.section { padding-block: var(--section-y); }
.section--pearl { background: var(--pearl); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

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

.section__head { max-width: var(--maxw-text); margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section__head p { color: var(--muted); }

/* 5. Skip link and focus ------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 0; top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); color: #fff; }

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

/* 6. Header and navigation ----------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

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

/* Wordmark / logo slot */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand__name b { color: var(--carnelian); font-weight: 700; }

/* Primary nav */
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
}
.nav__link:hover { color: var(--carnelian-dark); background: var(--pearl); }
.nav__link[aria-current="page"] { color: var(--carnelian); }

.pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--carnelian-dark);
  background: color-mix(in srgb, var(--carnelian) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--carnelian) 30%, var(--line));
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  line-height: 1.4;
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle:hover { background: var(--pearl); }
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after  { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { top: 0; transform: rotate(-45deg); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

/* 7. Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1.2;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--carnelian); color: #fff; border-color: var(--carnelian); }
.btn--primary:hover { background: var(--carnelian-dark); border-color: var(--carnelian-dark); color: #fff; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--carnelian); color: var(--carnelian-dark); background: var(--surface); }
.btn--small { padding: 0.5rem 0.85rem; font-size: 0.9rem; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Inline arrow link */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  text-decoration: none;
}
.arrow-link::after { content: "\2192"; transition: transform 0.15s ease; }
.arrow-link:hover::after { transform: translateX(3px); }

/* 8. Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: clamp(3rem, 9vw, 6.5rem);
  max-width: 56ch;
}
.hero h1 { margin-bottom: 0.5em; }
.hero .lead { margin-bottom: 1.75rem; }
.hero__motif {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  width: min(48%, 560px);
  pointer-events: none;
  opacity: 0.85;
}
@media (max-width: 700px) {
  .hero__motif { width: min(58%, 320px); inset: -4% -6% auto auto; height: 320px; opacity: 0.45; }
}

/* 9. Section intros and generic content ---------------------------------- */
.prose { max-width: var(--maxw-text); }
.prose h2 { margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink); }
.prose .muted { color: var(--muted); }

/* 10. Cards (doorways) --------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  height: 100%;
}
.card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.25rem;
}
.card p { color: var(--muted); margin: 0; flex: 1; }
.card .arrow-link { margin-top: 0.4rem; }

/* 11. Steps (how we work) ------------------------------------------------ */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.step {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--carnelian) 12%, var(--surface));
  color: var(--carnelian-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--carnelian) 25%, var(--line));
}
.step h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); }

/* 12. In focus / Taska block --------------------------------------------- */
.feature {
  display: grid;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.feature__body h2,
.feature__body h3 { margin-top: 0; }
.feature__body p { color: var(--muted); }
.feature__motif {
  align-self: stretch;
  min-height: 180px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--carnelian) 22%, transparent), transparent 60%),
    var(--pearl);
  display: grid;
  place-items: center;
}

/* 13. Audience strip ----------------------------------------------------- */
.audience {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.audience li {
  font-weight: 600;
  color: var(--ink);
}
.audience li:not(:last-child)::after {
  content: "\00B7";
  color: var(--carnelian);
  margin-left: 0.75rem;
  font-weight: 700;
}

/* 14. Page content lists ------------------------------------------------- */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.feature-list li {
  padding-left: 1.6rem;
  position: relative;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--carnelian);
}
.feature-list strong { display: block; }
.feature-list span { color: var(--muted); }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; }
.check-list li { position: relative; padding-left: 1.6rem; }
.check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--carnelian);
  font-weight: 700;
}

/* 15. Closing CTA band --------------------------------------------------- */
.cta-band { background: var(--ink); color: #fff; }
.cta-band .container { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.cta-band h2 { color: #fff; max-width: 22ch; }
.cta-band p { color: color-mix(in srgb, #fff 78%, transparent); max-width: 50ch; }
.cta-band .btn--primary { background: var(--carnelian); border-color: var(--carnelian); }
.cta-band .btn--primary:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* 16. Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  font-size: 0.95rem;
}
.footer__top {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
.footer__brand .brand { margin-bottom: 0.6rem; }
.footer__tag { color: var(--muted); max-width: 32ch; margin: 0; }
.footer__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}
.footer__col h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer__col a { color: var(--ink); text-decoration: none; }
.footer__col a:hover { color: var(--carnelian-dark); text-decoration: underline; }
.footer__legal {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
.footer__legal a { color: var(--muted); }
.footer__legal a:hover { color: var(--carnelian-dark); }
.ext::after { content: "\2197"; font-size: 0.8em; margin-left: 0.15em; }

/* 17. Contact page and forms --------------------------------------------- */
.contact-grid {
  display: grid;
  gap: clamp(1.5rem, 5vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem);
}
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .optional { color: var(--muted); font-weight: 400; }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--carnelian) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--carnelian);
}
.form-note { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.form-status { margin-top: 0.85rem; font-size: 0.9rem; color: var(--carnelian-dark); min-height: 1.2em; }

.direct-card { background: var(--pearl); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); }
.direct-card h2 { font-size: 1.3rem; }
.intent-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.intent-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.intent-list a:hover { border-color: var(--carnelian); color: var(--carnelian-dark); }
.intent-list a::after { content: "\2192"; color: var(--carnelian); }
.email-line { font-size: 1.05rem; font-weight: 600; word-break: break-word; }

/* 18. Legal pages -------------------------------------------------------- */
.legal { padding-block: var(--section-y); }
.legal .prose h2 { font-size: 1.3rem; }
.legal .prose h3 { font-size: 1.1rem; }
.legal .updated { color: var(--muted); font-size: 0.9rem; }
.placeholder-note {
  background: color-mix(in srgb, var(--carnelian) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--carnelian) 25%, var(--line));
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 0 0 2rem;
  font-size: 0.9rem;
  color: var(--ink);
}

/* 19. Utilities and reduced motion --------------------------------------- */
.visually-hidden {
  position: absolute !important;
  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; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }

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

/* 20. Responsive breakpoints --------------------------------------------- */

/* >= 640px : two-column footer cols, side-by-side CTA */
@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .cta-band .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
  }
  .cta-band__text { max-width: 40ch; }
  .cta-band h2 { margin-bottom: 0.25rem; }
  .cta-band p { margin-bottom: 0; }
}

/* >= 768px : contact two-up, feature two-up, footer layout */
@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1.1fr 0.9fr; }
  .feature { grid-template-columns: 1.4fr 1fr; }
  .feature__media-first .feature__motif { order: -1; }
  .footer__top { grid-template-columns: 1.2fr 2fr; gap: 3rem; }
  .footer__cols { grid-template-columns: repeat(3, 1fr); }
}

/* >= 900px : three doorway cards in a row */
@media (min-width: 900px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Desktop navigation >= 880px */
@media (min-width: 880px) {
  .nav-toggle { display: none; }
}

/* Four-step variant: 2-up then 4-up */
@media (min-width: 560px) { .steps--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .steps--4 { grid-template-columns: repeat(4, 1fr); } }

/* Mobile navigation < 880px ---------------------------------------------- */
@media (max-width: 879.98px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px -16px rgba(26, 23, 20, 0.35);
    padding: 0.75rem var(--pad) 1.25rem;
    transform: translateY(-130%);
    transition: transform 0.22s ease;
    visibility: hidden;
  }
  .nav[data-open="true"] { transform: translateY(0); visibility: visible; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .nav__link { padding: 0.85rem 0.6rem; font-size: 1.05rem; border-radius: 8px; }
  .nav__link:hover { background: var(--pearl); }
}
