/* =========================================================================
   Lewis Carney — site styles
   Five pages share this stylesheet:
     index.html       — home
     services.html    — services
     about.html       — about Lewis
     engagements.html — track record / problem patterns
     contact.html     — contact / book a call
   ========================================================================= */

:root {
  /* -------------------------------------------------------------------
     PALETTE — DARK (default)
     Light overrides live in the @media block below and via [data-theme="light"]
     ------------------------------------------------------------------- */
  --bg:           #0a0f1d;
  --bg-2:         #0b1020;
  --surface:      #121a2b;
  --surface-2:    #0f1727;
  --surface-3:    #182338;
  --text:         #e6ebf5;
  --text-strong:  #f3f6fc;
  --muted:        #a2aec2;
  --muted-2:      #828ea4;
  --line:         #263247;
  --line-soft:    #1c2740;
  --accent:       #8fb3ff;       /* cool blue — links, eyebrow */
  --accent-2:     #c7d7ff;       /* soft cool — heading accents */
  --warm:         #e58a2b;       /* warm orange — CTAs, highlights */
  --warm-soft:    rgba(229, 138, 43, 0.12);
  --warm-line:    rgba(229, 138, 43, 0.30);
  --good:         #5fd4a4;

  /* Body gradient (set as variable so light theme can swap) */
  --body-grad:    linear-gradient(180deg, #0a0f1d 0%, #0b1020 100%);
  --header-bg:    rgba(10, 15, 29, 0.85);
  --cta-grad:     linear-gradient(135deg, #16223a 0%, #0f1727 100%);
  --shadow:       0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-2:     0 4px 14px rgba(0, 0, 0, 0.25);

  /* Type scale */
  --font-sans:    "Inter", "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;

  /* Value-chain SVG tokens — used by inline diagrams on home + services.
     These adapt to theme via the light override block below. */
  --vc-panel-bg:    #0f1727;
  --vc-panel-line:  #263247;
  --vc-track-start: #263247;
  --vc-track-end:   #e58a2b;
  --vc-cool-fill:   #1c2740;
  --vc-cool-stroke: #8fb3ff;
  --vc-cool-text:   #8fb3ff;
  --vc-label:       #e6ebf5;
  --vc-sublabel:    #a2aec2;

  /* Layout */
  --max:        1080px;
  --max-narrow: 760px;
  --radius:     14px;
  --radius-lg:  20px;
}

/* -------------------------------------------------------------------------
   LIGHT THEME — auto-applied when the OS/browser prefers light.
   Manual override:  <html data-theme="light">  (or "dark" to force dark)
   ------------------------------------------------------------------------- */
/* Light theme tokens are kept in a single var group below so the @media
   block and the [data-theme="light"] block stay in sync. Edit one, sync the other. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    /* Cool blue-grey base — gives white cards room to pop, avoids beige */
    --bg:          #e9eef6;
    --bg-2:        #f3f6fb;
    --surface:     #ffffff;
    --surface-2:   #ffffff;
    --surface-3:   #eef2f9;
    --text:        #182137;
    --text-strong: #0a1124;
    --muted:       #54607a;
    --muted-2:     #7a849a;
    --line:        #d4dbe7;
    --line-soft:   #e3e8f0;
    --accent:      #2c54c8;
    --accent-2:    #1a3aa0;
    --warm:        #b86a1b;
    --warm-soft:   rgba(184, 106, 27, 0.06);
    --warm-line:   rgba(184, 106, 27, 0.32);
    --good:        #1e8e64;

    --body-grad:   linear-gradient(180deg, #e9eef6 0%, #f3f6fb 100%);
    --header-bg:   rgba(233, 238, 246, 0.85);
    /* Cooler, more saturated CTA gradient so the block actually pops on light */
    --cta-grad:    linear-gradient(135deg, #d6e1f5 0%, #e2eafa 100%);
    --shadow:      0 18px 45px rgba(20, 35, 70, 0.10);
    --shadow-2:    0 4px 14px rgba(20, 35, 70, 0.07);

    /* Value-chain SVG flips to a white panel with accent-coloured ring nodes */
    --vc-panel-bg:    #ffffff;
    --vc-panel-line:  #d4dbe7;
    --vc-track-start: #c8d0de;
    --vc-cool-fill:   #eef2f9;
    --vc-cool-stroke: #2c54c8;
    --vc-cool-text:   #2c54c8;
    --vc-label:       #0a1124;
    --vc-sublabel:    #54607a;
  }
}

/* Manual force-light (mirror of the @media block) */
[data-theme="light"] {
  --bg:          #e9eef6;
  --bg-2:        #f3f6fb;
  --surface:     #ffffff;
  --surface-2:   #ffffff;
  --surface-3:   #eef2f9;
  --text:        #182137;
  --text-strong: #0a1124;
  --muted:       #54607a;
  --muted-2:     #7a849a;
  --line:        #d4dbe7;
  --line-soft:   #e3e8f0;
  --accent:      #2c54c8;
  --accent-2:    #1a3aa0;
  --warm:        #b86a1b;
  --warm-soft:   rgba(184, 106, 27, 0.06);
  --warm-line:   rgba(184, 106, 27, 0.32);
  --good:        #1e8e64;
  --body-grad:   linear-gradient(180deg, #e9eef6 0%, #f3f6fb 100%);
  --header-bg:   rgba(233, 238, 246, 0.85);
  --cta-grad:    linear-gradient(135deg, #d6e1f5 0%, #e2eafa 100%);
  --shadow:      0 18px 45px rgba(20, 35, 70, 0.10);
  --shadow-2:    0 4px 14px rgba(20, 35, 70, 0.07);

  --vc-panel-bg:    #ffffff;
  --vc-panel-line:  #d4dbe7;
  --vc-track-start: #c8d0de;
  --vc-cool-fill:   #eef2f9;
  --vc-cool-stroke: #2c54c8;
  --vc-cool-text:   #2c54c8;
  --vc-label:       #0a1124;
  --vc-sublabel:    #54607a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--body-grad);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -------------------------------------------------------------------------
   Typography
   ------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); }
h3 { font-size: 1.15rem; color: var(--accent-2); }
h4 { font-size: 1rem; color: var(--text-strong); margin-bottom: 6px; }

p { margin: 0 0 14px; }
.lede { font-size: 1.1rem; color: var(--text); max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
strong { color: var(--text-strong); font-weight: 600; }

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

ul, ol { margin: 10px 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
ul.clean { list-style: none; padding-left: 0; }
ul.clean li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}
ul.clean li::before {
  content: "";
  position: absolute; left: 0; top: 11px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warm);
  opacity: 0.85;
}

/* -------------------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------------------- */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow {
  max-width: var(--max-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

section.section {
  padding: 64px 0;
  border-top: 1px solid var(--line-soft);
}
section.section:first-of-type { border-top: none; }

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 12px;
  border: 1px solid var(--warm-line);
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--warm) 0%, #b86d22 100%);
  color: #1a1300;
  font-weight: 800;
  font-size: 0.85rem;
}
.brand-name { font-size: 1.02rem; }
.brand-name .dot { color: var(--warm); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--text-strong);
  background: var(--surface-3);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--text-strong);
  background: var(--surface-2);
}
.nav-cta {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--warm);
  color: #1a1300;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  border: none;
}
.nav-cta:hover {
  background: #f1a04d;
  color: #1a1300;
  text-decoration: none;
}

/* Hamburger (CSS-only, no JS) */
.nav-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.nav-hamburger { display: none; }
.nav-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 720px) {
  /* Nav links hidden by default; shown when checkbox is checked */
  .nav-links { display: none; }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    cursor: pointer;
  }
  .nav-hamburger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text-strong);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  /* Dropdown panel — positioned below the sticky header */
  .nav-toggle-input:checked ~ nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-top: 1px solid var(--line-soft);
    padding: 10px 24px 18px;
  }
  .nav-toggle-input:checked ~ nav .nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  /* Hamburger → X animation */
  .nav-toggle-input:checked ~ .nav-end .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle-input:checked ~ .nav-end .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle-input:checked ~ .nav-end .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */

.hero {
  padding: 80px 0 56px;
  position: relative;
}
.hero h1 { margin-bottom: 18px; }
.hero .lede {
  font-size: 1.18rem;
  color: var(--accent-2);
  max-width: 50ch;
  margin-bottom: 22px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.hero-card h3 {
  margin-bottom: 12px;
  color: var(--accent-2);
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Headshot inside hero card (About page).
   Best practice: save your photo as a square crop ~400x400px JPG/PNG to
   assets/lewis.jpg. The browser handles downscaling but a pre-sized image
   loads faster and avoids any compression artefacts on huge originals.
   Adjust object-position if the auto-crop chops the face awkwardly. */
.headshot {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;     /* bias slightly upward so eyes land near centre */
  border: 3px solid var(--warm);
  box-shadow: var(--shadow-2);
  background: var(--surface-2);
}
/* Shown only when the img fails to load (handled by inline onerror) */
.headshot-fallback {
  width: 180px; height: 180px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid var(--warm);
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--warm);
  letter-spacing: -0.02em;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-strong);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.button:hover { background: var(--surface-3); filter: brightness(1.08); text-decoration: none; }
.button-primary {
  background: var(--warm);
  color: #1a1300;
  border-color: transparent;
}
.button-primary:hover { background: #f1a04d; color: #1a1300; }
.button-ghost {
  background: transparent;
  color: var(--text);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
@media (max-width: 880px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover {
  border-color: var(--warm-line);
}
.card h3 {
  color: var(--accent-2);
  margin-bottom: 10px;
}
.card .stage {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--warm-soft);
  color: var(--warm);
  margin-bottom: 12px;
}
.card .meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 14px;
}

/* Outcome cards (numbers) */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
@media (max-width: 880px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.metric {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
}
.metric .num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--warm);
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 4px;
}
.metric .label {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Service tiles (with side accent) */
.service {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.service::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--warm) 0%, transparent 80%);
}
.service h3 { color: var(--text-strong); }
.service .best-for {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.service .output {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--accent-2);
  font-size: 0.95rem;
}

/* -------------------------------------------------------------------------
   Visual blocks: stage / value chain
   ------------------------------------------------------------------------- */

/* Value-chain SVG panels — adapt to theme via the --vc-* tokens above. */
.value-chain {
  margin: 28px 0 8px;
  background: var(--vc-panel-bg);
  border: 1px solid var(--vc-panel-line);
  border-radius: var(--radius);
  padding: 24px;
}
.value-chain svg { width: 100%; height: auto; display: block; }
@media (max-width: 720px) {
  .value-chain { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .value-chain svg { min-width: 580px; }
}

/* SVG class hooks — attach to <stop>, <circle>, <text> in the inline SVGs */
.vc-track-cool      { stop-color: var(--vc-track-start); }
.vc-track-warm      { stop-color: var(--vc-track-end); }
.vc-track-line      { stroke: var(--vc-panel-line); }
.vc-step-cool       { fill: var(--vc-cool-fill); stroke: var(--vc-cool-stroke); }
.vc-step-num-cool   { fill: var(--vc-cool-text); }
.vc-step-num-warm   { fill: #1a1300; }
.vc-stage-title     { fill: var(--vc-label); }
.vc-stage-sub       { fill: var(--vc-sublabel); }
.vc-banner-bg       { fill: var(--warm-soft); stroke: var(--warm-line); }
.vc-banner-text     { fill: var(--warm); }

.competency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}
@media (max-width: 720px) {
  .competency-grid { grid-template-columns: 1fr; }
}
.competency {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.competency h4 {
  color: var(--warm);
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.competency strong { color: var(--text-strong); display: block; font-size: 1.05rem; margin-bottom: 6px; }

/* Quote / pull-out block */
.pullquote {
  margin: 22px 0;
  padding: 22px 26px;
  background: var(--warm-soft);
  border-left: 4px solid var(--warm);
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 1.05rem;
  line-height: 1.55;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 26px 0 8px;
  padding-left: 24px;
  border-left: 2px solid var(--line);
}
.timeline-row {
  position: relative;
  padding: 10px 0 22px;
}
.timeline-row::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 16px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline-row .year {
  display: inline-block;
  font-weight: 700;
  color: var(--warm);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.timeline-row strong { color: var(--text-strong); display: block; margin-bottom: 4px; }
.timeline-row p { color: var(--muted); margin: 0; }

/* CTA block */
.cta-block {
  margin: 64px 0 0;
  background: var(--cta-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}
.cta-block h2 { margin-bottom: 10px; }
.cta-block p { color: var(--muted); max-width: 56ch; margin: 0 auto 22px; }

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

.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line-soft);
  padding: 32px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* -------------------------------------------------------------------------
   Utility
   ------------------------------------------------------------------------- */

.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; }

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 32px 0;
}
