/* ============================================================
   DYNALABZ — styles.css
   Mobile-first. No inline styles anywhere. No style= attributes.
   All interactivity driven from script.js via classes.
   See /fonts/README.md for font download instructions.
   ============================================================ */


/* ============================================================
   @FONT-FACE — self-hosted, no Google Fonts CDN
   ============================================================ */

/* Bricolage Grotesque — variable font (covers all weights) */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/BricolageGrotesque-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Bricolage Grotesque — static fallbacks if variable font unavailable */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/BricolageGrotesque-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/BricolageGrotesque-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Inter — variable font (recommended) */
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter.var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Inter — static fallbacks */
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Space Mono — monospace eyebrow labels */
@font-face {
  font-family: 'Space Mono';
  src: url('fonts/SpaceMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */

:root {
  /* Brand palette */
  --pine:       #15403A;
  --pine-soft:  #7FB5AB;
  --pine-soft2: #A9C7C1;
  --rust:       #D2691E;
  --rust-light: #E8965A;
  --rust-dark:  #B05516; /* WCAG AA contrast for interactive text/buttons */
  --cream:      #F2EDE1;
  --ivory:      #F8F4EA;
  --text:       #4A5E58;
  --text-soft:  #6E817B;
  --heading:    var(--pine);
  --line:       #E2DBCB;
  --pine-deep:  #0E2D29;
  --radius:     18px;
  --radius-lg:  26px;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);

  /* Typography families */
  --font-headline: 'Bricolage Grotesque', 'Fraunces', Georgia, serif;
  --font-body:     'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'Space Mono', 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing scale */
  --space-xs:  0.375rem;   /*  6px */
  --space-sm:  0.75rem;    /* 12px */
  --space-md:  1.25rem;    /* 20px */
  --space-lg:  2rem;       /* 32px */
  --space-xl:  3.5rem;     /* 56px */
  --space-2xl: 5.5rem;     /* 88px */

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition: 0.2s ease;

  /* Container */
  --max-width: 1200px;
  --container-pad: 1.25rem;
}


/* ============================================================
   RESET & BASE
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Smooth focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ============================================================
   ACCESSIBILITY — SKIP LINK
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--pine);
  color: var(--cream);
  font-size: 0.875rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 0;
}


/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

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

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


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

/* Eyebrow labels — pill badge, monospace, small caps */
.eyebrow {
  display: inline-block;
  padding: 0.28em 0.85em;
  background-color: rgba(176, 85, 22, 0.08);
  border: 1px solid rgba(176, 85, 22, 0.22);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.775rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rust-dark);
  margin-bottom: var(--space-md);
}

/* Eyebrow on rust-coloured backgrounds */
.eyebrow--rust {
  color: rgba(242, 237, 225, 0.9);
  background-color: rgba(242, 237, 225, 0.12);
  border-color: rgba(242, 237, 225, 0.22);
}

/* Eyebrow on dark pine backgrounds */
.eyebrow--cream {
  color: var(--pine-soft2);
  background-color: rgba(169, 199, 193, 0.1);
  border-color: rgba(169, 199, 193, 0.24);
}

/* Section headings */
.section-headline {
  font-family: var(--font-headline);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--heading);
}

.section-headline--lg {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-headline--xl {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
}

/* Rust accent on second headline line */
.headline-rust {
  display: block;
  color: var(--rust);
}

/* Rust-light accent — for use on dark (pine) backgrounds (WCAG AA: ~4.9:1 on pine) */
.headline-rust-light {
  display: block;
  color: var(--rust-light);
}

/* On pine backgrounds, headline uses cream */
.headline-cream {
  display: block;
  color: var(--cream);
}

/* Body / lead text */
.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 56ch;
}

.lead--lg {
  font-size: 1.25rem;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary — dark rust fill, cream text (WCAG AA: rust-dark on cream ~5:1) */
.btn-primary {
  background-color: var(--rust-dark);
  color: var(--cream);
  border: 2px solid var(--rust-dark);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--rust);
  border-color: var(--rust);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(176, 85, 22, 0.35);
}

/* Secondary — transparent with pine border */
.btn-secondary {
  background-color: transparent;
  color: var(--pine);
  border: 2px solid var(--pine);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background-color: var(--pine);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(21, 64, 58, 0.2);
}

/* Secondary variant on pine backgrounds */
.btn-secondary--light {
  background-color: transparent;
  color: var(--cream);
  border: 2px solid var(--cream);
}

.btn-secondary--light:hover,
.btn-secondary--light:focus-visible {
  background-color: var(--cream);
  color: var(--pine);
  transform: translateY(-2px);
}

/* CTA nav button — smaller */
.nav-cta.btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

/* Centre-aligned btn-group — used in CTA bands */
.btn-group.text-center {
  justify-content: center;
}


/* ============================================================
   SITE HEADER & NAV
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--cream);
  border-bottom: 1px solid rgba(21, 64, 58, 0.12);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: 4rem;
}

/* Brand / wordmark */
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-headline);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.header-brand:hover {
  color: var(--rust-dark);
}

.brand-bolt {
  width: 24px;
  height: 24px;
  color: var(--pine);
  flex-shrink: 0;
}

.header-brand:hover .brand-bolt {
  color: var(--rust-dark);
}

/* Desktop nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--pine);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  border-bottom-color: var(--rust);
  color: var(--pine);
}

/* Mobile hamburger toggle */
.nav-toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  padding: 4px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background-color: var(--pine);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition), width var(--transition);
  transform-origin: center;
}

.nav-toggle-bar:nth-child(1) { width: 22px; }
.nav-toggle-bar:nth-child(2) { width: 18px; }
.nav-toggle-bar:nth-child(3) { width: 22px; }

/* Hamburger → X when open */
.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  width: 22px;
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  width: 22px;
  transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   MOBILE NAV — CTA in header bar (hidden on desktop)
   ============================================================ */

.nav-cta-mobile {
  display: none;
}

/* ============================================================
   MOBILE NAV — drawer brand (hidden on desktop)
   ============================================================ */

.nav-drawer-brand {
  display: none;
}

/* ============================================================
   NAV OVERLAY — backdrop behind the drawer
   ============================================================ */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* ============================================================
   MOBILE NAV OVERLAY
   ============================================================ */

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  /* Tighten header row gap on mobile */
  .site-header .container {
    gap: 0.5rem;
  }

  /* CTA button visible in header bar on mobile */
  .nav-cta-mobile {
    display: inline-flex;
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 1;
    min-width: 0;
  }

  /* Drawer slides in from right, 90% width */
  .site-nav {
    position: fixed;
    top: 4rem;
    right: 0;
    bottom: 0;
    left: auto;
    width: 90vw;
    background-color: var(--cream);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: var(--space-lg) var(--space-lg);
    gap: var(--space-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -6px 0 32px rgba(0, 0, 0, 0.18);
  }

  .site-header.nav-open .site-nav {
    transform: translateX(0);
  }

  /* Brand shown at top of drawer */
  .nav-drawer-brand {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-headline);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--pine);
    letter-spacing: -0.02em;
    width: 100%;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(21, 64, 58, 0.12);
    flex-shrink: 0;
  }

  .nav-drawer-brand .brand-bolt {
    width: 24px;
    height: 24px;
    color: var(--pine);
    flex-shrink: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    width: 100%;
  }

  .nav-link {
    font-family: var(--font-headline);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    border-bottom: none;
    padding-bottom: 0;
  }

  .nav-link:hover,
  .nav-link[aria-current="page"] {
    color: var(--rust-dark);
    border-bottom: none;
  }

  .nav-cta.btn {
    font-size: 1.125rem;
    padding: 0.75rem 1.75rem;
    margin-top: var(--space-sm);
  }
}


/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  background-color: var(--pine);
  color: var(--pine-soft2);
  padding-block: var(--space-xl);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.footer-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.footer-brand svg {
  color: var(--rust-light);
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--pine-soft2);
  max-width: 30ch;
}

.footer-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.footer-nav-list a {
  font-size: 0.9375rem;
  color: var(--pine-soft2);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-nav-list a:hover {
  color: var(--cream);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-email {
  font-size: 0.9375rem;
  color: var(--pine-soft2);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-email:hover {
  color: var(--cream);
}

.footer-socials {
  display: flex;
  gap: var(--space-sm);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(169, 199, 193, 0.3);
  color: var(--pine-soft2);
  transition: border-color var(--transition), color var(--transition);
}

.social-link:hover {
  border-color: var(--pine-soft2);
  color: var(--cream);
}

.footer-bottom {
  border-top: 1px solid rgba(169, 199, 193, 0.2);
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
  font-size: 0.8125rem;
  color: rgba(169, 199, 193, 0.7);
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: start;
  }
}


/* ============================================================
   SECTION SPACING
   ============================================================ */

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

.section--lg {
  padding-block: var(--space-2xl);
}

/* Pine dark section */
.section--pine {
  background-color: var(--pine);
  color: var(--pine-soft2);
}

/* Ivory section */
.section--ivory {
  background-color: var(--ivory);
}

/* Rust section */
.section--rust {
  background-color: var(--rust);
  color: var(--cream);
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-header--center {
  text-align: center;
}

.section-header--center .lead {
  margin-inline: auto;
}


/* ============================================================
   HERO (index.html)
   ============================================================ */

.hero {
  padding-block: var(--space-2xl);
  overflow-x: clip; /* prevent horizontal scroll without clipping chip shadows vertically */
}

/* Two-column layout — stacks on mobile, side-by-side on desktop */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

@media (min-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr 360px;
  }
}

.hero-content {
  max-width: 620px;
}

.hero-headline {
  font-family: var(--font-headline);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: var(--pine);
  margin-bottom: var(--space-lg);
}

.hero-headline .headline-rust {
  margin-top: 0.05em;
}

.hero-lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.65;
  color: var(--text);
  max-width: 52ch;
  margin-bottom: var(--space-xl);
}

.hero-note {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--rust-dark);
  letter-spacing: 0.05em;
  margin-top: var(--space-md);
  opacity: 0.75;
}

/* Decorative chat panel — hidden on mobile, shown on desktop */
.hero-visual {
  display: none;
  position: relative;
  height: 500px;
  flex-shrink: 0;
}

@media (min-width: 960px) {
  .hero-visual {
    display: block;
  }
}

/* Rust accent slab behind the card — gives the stacked editorial depth */
.hero-card-accent {
  position: absolute;
  inset: 0;
  background-color: var(--rust);
  border-radius: var(--radius-md);
  transform: rotate(-2.5deg);
  opacity: 0.2;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pine card — chat widget */
.hero-card {
  position: absolute;
  inset: 0;
  background-color: var(--pine);
  border-radius: var(--radius-md);
  transform: rotate(1deg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(21, 64, 58, 0.32);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
  cursor: default;
}

/* Hover — card lifts, tilts opposite direction, accent slab shifts further */
.hero-visual:hover .hero-card {
  transform: rotate(-1deg) translateY(-10px) scale(1.018);
  box-shadow: 0 40px 80px rgba(21, 64, 58, 0.48);
}

.hero-visual:hover .hero-card-accent {
  transform: rotate(-5deg) translateY(-5px);
}

/* ---- Chat header bar ---- */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8125rem 1rem;
  border-bottom: 1px solid rgba(169, 199, 193, 0.12);
  flex-shrink: 0;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Animated green "online" dot */
.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: statusPulse 2.4s ease infinite;
}

.chat-status-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cream);
  letter-spacing: 0.04em;
}

.chat-header-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--pine-soft2);
  letter-spacing: 0.08em;
  opacity: 0.65;
}

/* ---- Messages area ---- */
.chat-messages {
  flex: 1;
  overflow: hidden;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  position: relative; /* typing wrapper is absolute inside here */
}

/* ---- Message row (avatar + bubble together) ---- */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  opacity: 0;
  /* duration/easing/fill shared; animation-name overridden per sender below */
  animation-duration: 0.65s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
}

.chat-row--client {
  flex-direction: row;
  justify-content: flex-start;
  animation-name: clientMessageIn; /* slides in from the left */
}

.chat-row--dl {
  flex-direction: row;
  justify-content: flex-end;
  animation-name: dlMessageIn;     /* springs in from the right */
}

/* Avatar circle */
.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar svg { width: 13px; height: 13px; }

.chat-avatar--client {
  background-color: rgba(169, 199, 193, 0.22);
  color: var(--pine-soft2);
}

.chat-avatar--dl {
  background-color: var(--rust-dark);
  color: var(--cream);
}

/* Spacer — holds avatar column width for consecutive same-sender messages */
.chat-avatar-spacer {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* ---- Bubble base ---- */
.chat-bubble {
  max-width: 78%; /* slightly narrower — avatar takes remaining space */
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.5;
  /* row handles the fade-in; bubble itself is always visible inside its row */
  opacity: 1;
  animation: none;
}

.chat-bubble p {
  margin: 0;
  color: inherit;
}

/* Client message — left, subtle glass on pine */
.chat-bubble--client {
  background-color: rgba(169, 199, 193, 0.14);
  color: var(--pine-soft2);
  border-bottom-left-radius: 4px;
}

/* Dynalabz message — right, rust */
.chat-bubble--dl {
  background-color: var(--rust-dark);
  color: var(--cream);
  border-bottom-right-radius: 4px;
}

/* Typing indicator wrapper — absolutely positioned, never shifts flex layout */
.chat-typing-wrapper {
  position: absolute;
  bottom: 0.875rem;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
}

/* DL side — right, slides in from right */
.chat-typing-wrapper--dl {
  right: 1rem;
  flex-direction: row;      /* [bubble][avatar] */
  animation-name: typingAppear;
}

/* Client side — left, slides in from left */
.chat-typing-wrapper--client {
  left: 1rem;
  flex-direction: row;      /* [avatar][bubble] */
  animation-name: typingAppearClient;
}

/* Per-indicator delay + duration — duration is proportional to message length */
.chat-typing-wrapper--1 { animation-delay: 1.7s;  animation-duration: 1.8s; } /* before short DL reply */
.chat-typing-wrapper--2 { animation-delay: 4.0s;  animation-duration: 1.5s; } /* before short client reply */
.chat-typing-wrapper--3 { animation-delay: 6.3s;  animation-duration: 2.4s; } /* before long DL advice */
.chat-typing-wrapper--4 { animation-delay: 12.5s; animation-duration: 1.5s; } /* before client punchline */

/* The dots bubble */
.chat-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background-color: var(--rust-dark);
  border-radius: 14px 14px 4px 14px;
}

/* Bouncing dots */
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(242, 237, 225, 0.85);
  animation: dotWave 1.1s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

/* ---- Footer ---- */
.chat-footer {
  flex-shrink: 0;
  padding: 0.625rem 1rem;
  border-top: 1px solid rgba(169, 199, 193, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-footer-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--pine-soft2);
  letter-spacing: 0.05em;
  opacity: 0;
  animation: bubbleIn 0.4s ease forwards;
}

/* Tighter gap between consecutive messages from the same sender */
.chat-bubble--4 { margin-bottom: -0.15rem; }

/* ---- Animation timing ---- */
/* Every message except the first is preceded by a typing indicator.
   Each bubble appears just as its preceding typing indicator fades (smooth handoff). */
.chat-bubble--1    { animation-delay: 0.5s; }   /* opens the conversation */
.chat-bubble--2    { animation-delay: 3.0s; }   /* typing-1 fades ~3.1s  */
.chat-bubble--3    { animation-delay: 5.2s; }   /* typing-2 fades ~5.3s  */
.chat-bubble--4    { animation-delay: 8.4s; }   /* typing-3 fades ~8.5s  */
.chat-bubble--5    { animation-delay: 11.2s; }  /* consecutive DL — no typing, 2.8s to read msg 4 */
.chat-bubble--6    { animation-delay: 13.8s; }  /* typing-4 fades ~13.9s */
.chat-footer-badge { animation-delay: 15.2s; }  /* punchline badge 1.4s after msg 6 */

/* ---- Keyframes ---- */

/* Generic upward fade — footer badge, scroll-reveal elements */
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Client messages — slide in from the left */
@keyframes clientMessageIn {
  from {
    opacity: 0;
    transform: translateX(-16px) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

/* Dynalabz messages — spring in from the right, slight overshoot at 55% */
@keyframes dlMessageIn {
  0% {
    opacity: 0;
    transform: translateX(16px) translateY(4px) scale(0.95);
  }
  55% {
    opacity: 1;
    transform: translateX(-3px) translateY(-1px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

/* DL typing — pops in from the right, holds, fades right */
@keyframes typingAppear {
  0%   { opacity: 0; transform: translateX(12px) scale(0.88); }
  14%  { opacity: 1; transform: translateX(0)    scale(1);    }
  74%  { opacity: 1; transform: translateX(0)    scale(1);    }
  90%  { opacity: 0; transform: translateX(5px)  scale(0.94); }
  100% { opacity: 0; }
}

/* Client typing — mirrored: pops in from the left, fades left */
@keyframes typingAppearClient {
  0%   { opacity: 0; transform: translateX(-12px) scale(0.88); }
  14%  { opacity: 1; transform: translateX(0)     scale(1);    }
  74%  { opacity: 1; transform: translateX(0)     scale(1);    }
  90%  { opacity: 0; transform: translateX(-5px)  scale(0.94); }
  100% { opacity: 0; }
}

/* Dots — smooth cascading wave, one dot at a time */
@keyframes dotWave {
  0%, 50%, 100% { transform: translateY(0);    opacity: 0.55; }
  25%           { transform: translateY(-7px); opacity: 1;    }
}

/* Pulsing green status dot */
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  50%       { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
}

/* Respect user's reduced-motion preference — show everything immediately */
@media (prefers-reduced-motion: reduce) {
  .chat-bubble,
  .chat-typing,
  .chat-footer-badge {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .typing-dot,
  .chat-status-dot {
    animation: none;
  }
}


/* ============================================================
   SERVICES TEASER (index.html)
   ============================================================ */

.services-teaser-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.teaser-card {
  background-color: var(--ivory);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid rgba(21, 64, 58, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}

.teaser-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(21, 64, 58, 0.1);
}

.teaser-card-icon {
  width: 40px;
  height: 40px;
  color: var(--rust-dark);
  margin-bottom: var(--space-md);
}

.teaser-card h3 {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.teaser-card p {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
}

.services-teaser-cta {
  text-align: center;
}

@media (min-width: 640px) {
  .services-teaser-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .services-teaser-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ============================================================
   DIFFERENCE SECTION (index.html, pine bg)
   ============================================================ */

.difference-headline {
  font-family: var(--font-headline);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--cream);
  margin-bottom: var(--space-xl);
}

.difference-props {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.diff-prop {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.diff-prop-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--rust-light);
  margin-top: 2px;
}

.diff-prop-title {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-xs);
}

.diff-prop-body {
  font-size: 0.9375rem;
  color: var(--pine-soft2);
  line-height: 1.65;
}

@media (min-width: 768px) {
  .difference-props {
    grid-template-columns: repeat(3, 1fr);
  }

  .diff-prop {
    flex-direction: column;
  }
}


/* ============================================================
   CTA BAND
   ============================================================ */

.cta-band {
  padding-block: var(--space-2xl);
  text-align: center;
}

.cta-band-headline {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.cta-band-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--rust-dark);
  letter-spacing: 0.06em;
  margin-top: var(--space-md);
  opacity: 0.72;
}

/* CTA band on pine bg */
.cta-band--pine {
  background-color: var(--pine);
}

.cta-band--pine .cta-band-headline {
  color: var(--cream);
}

.cta-band--pine .cta-band-note {
  color: var(--pine-soft2);
  opacity: 0.85;
}


/* ============================================================
   SERVICES PAGE
   ============================================================ */

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.service-block {
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.service-block--ivory {
  background-color: var(--ivory);
}

.service-block--pine {
  background-color: var(--pine);
}

.service-block--rust {
  background-color: var(--rust);
}

.service-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.service-icon {
  width: 48px;
  height: 48px;
  color: var(--rust-dark);
  flex-shrink: 0;
}

.service-block--pine .service-icon {
  color: var(--rust-light);
}

.service-block--rust .service-icon {
  color: var(--cream);
}

.service-title {
  font-family: var(--font-headline);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--pine);
  margin-bottom: var(--space-xs);
}

.service-block--pine .service-title {
  color: var(--cream);
}

.service-block--rust .service-title {
  color: var(--cream);
}

.service-tagline {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--rust-dark);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
}

.service-block--pine .service-tagline {
  color: var(--rust-light);
}

.service-block--rust .service-tagline {
  color: rgba(242, 237, 225, 0.85);
}

.service-body {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
}

.service-block--pine .service-body {
  color: var(--pine-soft2);
}

.service-block--rust .service-body {
  color: rgba(242, 237, 225, 0.9);
}

@media (min-width: 768px) {
  .service-block {
    grid-template-columns: auto 1fr;
    align-items: flex-start;
  }

  .service-icon {
    width: 56px;
    height: 56px;
  }
}


/* ============================================================
   PROCESS PAGE
   ============================================================ */

.process-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  counter-reset: steps;
}

.process-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-lg);
  align-items: flex-start;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 400;
  color: var(--rust);
  line-height: 1;
  flex-shrink: 0;
  min-width: 3.5rem;
}

.step-title {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-sm);
}

.step-body {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 60ch;
}

.process-divider {
  display: none;
  height: 1px;
  background: rgba(21, 64, 58, 0.1);
}

@media (min-width: 640px) {
  .step-number {
    font-size: 4.5rem;
    min-width: 5.5rem;
  }
}


/* ============================================================
   ABOUT PAGE
   ============================================================ */

/* Intro statement — full-width, larger, bolder */
.about-story-intro {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 500;
  color: var(--pine);
  line-height: 1.65;
  max-width: 60ch;
  margin-bottom: var(--space-xl);
}

/* Body paragraphs — two-column newspaper flow */
.about-story-columns {
  column-count: 2;
  column-gap: clamp(2.5rem, 5vw, 4.5rem);
  column-rule: 1px solid rgba(21, 64, 58, 0.1);
}

.about-story-columns p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: var(--space-lg);
  break-inside: avoid;
}

.about-story-columns p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .about-story-columns { column-count: 1; }
}

.about-callout {
  background-color: var(--ivory);
  border-left: 4px solid var(--rust);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--pine);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.about-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.about-value {
  background-color: var(--ivory);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.about-value-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rust-dark);
  opacity: 0.7;
  margin-bottom: var(--space-sm);
}

.about-value h3 {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.about-value p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text);
}

.about-photo-placeholder {
  background-color: var(--pine);
  border-radius: var(--radius-md);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-placeholder-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--pine-soft2);
  text-align: center;
}

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

.testimonial {
  background-color: var(--ivory);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.testimonial-quote {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.testimonial-source {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rust-dark);
  opacity: 0.65;
}

@media (min-width: 768px) {
  .about-values {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ============================================================
   CONTACT PAGE & FORM
   ============================================================ */

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

.contact-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-info-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rust-dark);
  opacity: 0.7;
}

.contact-info-value {
  font-size: 1rem;
  color: var(--pine);
  font-weight: 500;
}

.contact-info-value a {
  color: var(--rust-dark);
  text-decoration: none;
  transition: color var(--transition);
}

.contact-info-value a:hover {
  color: var(--rust);
  text-decoration: underline;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cal-booking {
  display: none;
}

.cal-mobile-cta {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  font-size: 1.125rem;
  padding: 1rem 2rem;
}

@media (min-width: 900px) {
  .cal-booking {
    display: block;
    width: 100%;
    border-radius: var(--radius);
  }

  .cal-mobile-cta {
    display: none;
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rust-dark);
  opacity: 0.65;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(21, 64, 58, 0.2);
  border-radius: var(--radius-md);
  background-color: var(--ivory);
  color: var(--pine);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(74, 94, 88, 0.45);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(21, 64, 58, 0.12);
}

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

/* Honeypot field — hidden from real users, visible to bots */
/* JS also rejects submission if this is filled */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.form-submit {
  align-self: flex-start;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--pine-soft);
  line-height: 1.5;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: 2fr 3fr;
    align-items: start;
    gap: var(--space-2xl);
  }
}


/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */

.page-hero {
  padding-block: var(--space-xl) var(--space-xl);
}

.page-hero-headline {
  font-family: var(--font-headline);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--pine);
  margin-bottom: var(--space-md);
}

.page-hero-lead {
  font-size: 1.125rem;
  color: var(--text);
  max-width: 56ch;
  line-height: 1.65;
}


/* ============================================================
   UTILITY SPACING / MISC
   ============================================================ */

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }

.text-center { text-align: center; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid rgba(21, 64, 58, 0.1);
  margin-block: var(--space-xl);
}

/* Screen-reader-only but focusable */
.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}


/* ============================================================
   HERO ENTRANCE — CSS-only, fires on page load
   ============================================================ */

@keyframes heroIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroSlideRight {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}

.hero .eyebrow           { animation: heroIn 0.6s cubic-bezier(0.16,1,0.3,1) 0.1s  both; }
.hero .hero-headline     { animation: heroIn 0.75s cubic-bezier(0.16,1,0.3,1) 0.22s both; }
.hero .hero-lead         { animation: heroIn 0.7s cubic-bezier(0.16,1,0.3,1) 0.38s  both; }
.hero .btn-group         { animation: heroIn 0.7s cubic-bezier(0.16,1,0.3,1) 0.52s  both; }
.hero .hero-note         { animation: heroIn 0.6s cubic-bezier(0.16,1,0.3,1) 0.68s  both; }
.hero .hero-visual       { animation: heroSlideRight 0.85s cubic-bezier(0.16,1,0.3,1) 0.3s both; }

/* Inner-page hero entrance */
.page-hero .eyebrow          { animation: heroIn 0.6s cubic-bezier(0.16,1,0.3,1) 0.05s both; }
.page-hero .page-hero-headline { animation: heroIn 0.7s cubic-bezier(0.16,1,0.3,1) 0.18s both; }
.page-hero .page-hero-lead   { animation: heroIn 0.65s cubic-bezier(0.16,1,0.3,1) 0.34s both; }


/* ============================================================
   SCROLL REVEAL SYSTEM
   The document root gets class "js" from script.js.
   .reveal elements start hidden; JS adds .visible on intersection.
   .stagger containers animate their direct children sequentially.
   ============================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger: children animate sequentially when parent gets .visible */
.js .stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.js .stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Progressive delays — works for up to 6 children */
.stagger > *:nth-child(1) { transition-delay: 0.04s; }
.stagger > *:nth-child(2) { transition-delay: 0.14s; }
.stagger > *:nth-child(3) { transition-delay: 0.24s; }
.stagger > *:nth-child(4) { transition-delay: 0.34s; }
.stagger > *:nth-child(5) { transition-delay: 0.44s; }
.stagger > *:nth-child(6) { transition-delay: 0.54s; }


/* ============================================================
   ENHANCED HOVER & MICRO-INTERACTIONS
   ============================================================ */

/* Icon pop on card hover */
.teaser-card-icon,
.diff-prop-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.teaser-card:hover .teaser-card-icon {
  transform: scale(1.15) rotate(-5deg);
}

.diff-prop:hover .diff-prop-icon {
  transform: scale(1.12) translateY(-3px);
}

/* Service icon pop (services page) */
.service-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-block:hover .service-icon {
  transform: scale(1.1) translateY(-4px);
}

/* Process step: slide right + number colour shift */
.process-step {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-step:hover {
  transform: translateX(8px);
}

.step-number {
  transition: color 0.25s ease;
}

.process-step:hover .step-number {
  color: var(--rust-dark);
}

/* About value & testimonial card lift */
.about-value,
.testimonial {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.about-value:hover,
.testimonial:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(21, 64, 58, 0.12);
}

/* Diff prop row lift */
.diff-prop {
  transition: transform 0.25s ease;
  cursor: default;
}

.diff-prop:hover {
  transform: translateY(-4px);
}

/* Brand bolt spring on logo hover */
.header-brand .brand-bolt {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.header-brand:hover .brand-bolt {
  transform: scale(1.25) rotate(-10deg);
}

/* Button active press */
.btn:active {
  transform: scale(0.96) translateY(1px) !important;
  transition-duration: 0.08s !important;
}

/* CTA band primary button: gentle glow pulse (starts after 3s) */
.cta-band .btn-primary {
  animation: ctaGlow 3.5s ease-in-out infinite 3s;
}

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(176, 85, 22, 0.35); }
  50%       { box-shadow: 0 6px 32px rgba(176, 85, 22, 0.65), 0 0 0 6px rgba(176, 85, 22, 0.1); }
}

/* Form field subtle scale on focus */
.form-input,
.form-textarea {
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  transform: scale(1.008);
}

/* Footer nav underline draw */
.footer-nav-list a {
  position: relative;
}

.footer-nav-list a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--pine-soft2);
  transition: width 0.25s ease;
}

.footer-nav-list a:hover::after {
  width: 100%;
}

/* Social link hover bounce */
.social-link {
  transition: border-color var(--transition), color var(--transition),
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-link:hover {
  transform: translateY(-3px) scale(1.1);
}

/* About callout border pulse */
.about-callout {
  transition: border-color 0.3s ease;
}

.about-callout:hover {
  border-left-color: var(--rust-dark);
}

/* Teaser card — raise icon container colour on hover */
.teaser-card {
  transition: transform var(--transition), box-shadow var(--transition), border-color 0.25s ease;
}

.teaser-card:hover {
  border-color: rgba(21, 64, 58, 0.2);
}


/* ============================================================
   REDUCED MOTION — suppress all decorative animation
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  /* Hero entrance */
  .hero .eyebrow, .hero .hero-headline, .hero .hero-lead,
  .hero .btn-group, .hero .hero-note, .hero .hero-visual,
  .page-hero .eyebrow, .page-hero .page-hero-headline, .page-hero .page-hero-lead {
    animation: none;
    opacity: 1;
    transform: none;
  }

  /* Scroll reveal */
  .js .reveal,
  .js .stagger > * {
    transition: none;
    opacity: 1;
    transform: none;
  }

  /* Chat & status pulse */
  .chat-row,
  .chat-typing-wrapper,
  .chat-footer-badge,
  .typing-dot,
  .chat-status-dot {
    animation: none;
    opacity: 1;
    transform: none;
  }

  /* Hover micro-interactions */
  .teaser-card:hover .teaser-card-icon,
  .diff-prop:hover .diff-prop-icon,
  .service-block:hover .service-icon,
  .header-brand:hover .brand-bolt,
  .process-step:hover,
  .diff-prop:hover,
  .about-value:hover, .testimonial:hover,
  .social-link:hover {
    transform: none;
  }

  /* CTA glow */
  .cta-band .btn-primary {
    animation: none;
  }
}


/* ============================================================
   PROCESS PAGE — scroll-driven interactive section
   All class names are prefixed proc- or scoped to .process /
   .stage / .rail / .panels to avoid collisions.
   ============================================================ */

/* ---- Ease token (local to this section) ---- */
:root {
  --proc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Outer scroll container — 600 vh gives scroll distance ---- */
.process {
  --p: 0;         /* 0-1 rail fill, set by JS */
  position: relative;
  height: 600vh;
  background: var(--cream);
}

/* ---- Sticky viewport-filling stage ---- */
.stage {
  position: sticky;
  top: 4rem;                    /* sits below the 64-px site nav */
  height: calc(100vh - 4rem);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 85% 12%, color-mix(in srgb, var(--pine-soft) 18%, transparent), transparent 60%),
    radial-gradient(90% 80% at 5%  100%, color-mix(in srgb, var(--rust-light) 12%, transparent), transparent 55%),
    var(--ivory);
}

.stage__inner {
  position: relative;
  width: min(1180px, 92vw);
  height: min(680px, 84%);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(20px, 3.2vh, 44px);
}

/* ---- Section header ---- */
.proc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  transition: opacity .6s var(--proc-ease), transform .6s var(--proc-ease);
}

.proc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust-dark);
  margin-bottom: 0.5rem;
}

.proc-kicker::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--rust);
  display: inline-block;
  flex-shrink: 0;
}

.proc-title {
  font-family: var(--font-headline);
  font-weight: 600;
  color: var(--heading);
  font-size: clamp(1.625rem, 3.4vw, 2.875rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 14ch;
}

.proc-title em {
  font-style: normal;
  color: var(--rust-dark);
}

.proc-count {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: rgba(74, 94, 88, 0.7);
  letter-spacing: 0.1em;
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 0.25rem;
}

.proc-count b {
  color: var(--pine);
  font-weight: 700;
}

/* ---- Main two-column grid ---- */
.proc-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(28px, 5vw, 72px);
  min-height: 0;
  transition: opacity .6s var(--proc-ease), transform .6s var(--proc-ease);
}

/* ---- Rail (left column) ---- */
.rail {
  position: relative;
  display: flex;
}

.rail__track {
  position: absolute;
  left: 19px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: color-mix(in srgb, var(--pine-soft) 55%, transparent);
  border-radius: 2px;
  overflow: hidden;
}

.rail__fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--p) * 100%);
  background: linear-gradient(var(--rust), var(--rust-light));
  border-radius: 2px;
  transition: height .12s linear;
}

.rail__nodes {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
}

.node {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

/* Hover state — only on inactive nodes so active one doesn't wobble */
.node:not(.is-active):hover .node__dot {
  border-color: color-mix(in srgb, var(--rust) 55%, var(--pine-soft));
  color: var(--pine);
  transform: scale(1.08);
}

.node:not(.is-active):hover .node__label {
  color: var(--text);
}

/* Keyboard focus ring */
.node:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 4px;
  border-radius: 4px;
}

.node__dot {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid color-mix(in srgb, var(--pine-soft) 70%, transparent);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--pine) 55%, var(--ivory));
  transition: all .45s var(--proc-ease);
  z-index: 1;
}

.node__dot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1.5px solid var(--rust);
  opacity: 0;
  transform: scale(.7);
  transition: all .45s var(--proc-ease);
}

.node__label {
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 1rem;
  color: color-mix(in srgb, var(--text) 60%, transparent);
  transition: all .45s var(--proc-ease);
  letter-spacing: -0.01em;
}

.node.is-done .node__dot {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--ivory);
}

.node.is-active .node__dot {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--rust) 65%, transparent);
}

.node.is-active .node__dot::after { opacity: 1; transform: scale(1); }
.node.is-active .node__label      { color: var(--pine); font-weight: 600; }
.node.is-done   .node__label      { color: color-mix(in srgb, var(--text) 80%, transparent); }

/* ---- Panels (right column) ---- */
.panels {
  position: relative;
  min-height: 0;
}

.panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: clamp(14px, 2.4vh, 26px);
  align-content: start;
  opacity: 0;
  transform: translateY(26px);
  pointer-events: none;
  transition: opacity .55s var(--proc-ease), transform .55s var(--proc-ease);
}

.panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.panel__bignum {
  position: absolute;
  top: -8%;
  right: -1%;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(140px, 22vw, 300px);
  line-height: 1;
  color: color-mix(in srgb, var(--pine-soft) 26%, transparent);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.panel__icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--rust) 12%, var(--ivory));
  border: 1.5px solid color-mix(in srgb, var(--rust) 35%, transparent);
  color: var(--rust-dark);
}

.panel__icon svg {
  width: 32px;
  height: 32px;
}

.panel__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-headline);
  font-weight: 600;
  color: var(--heading);
  font-size: clamp(1.875rem, 4.4vw, 3.75rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
}

.panel__body {
  position: relative;
  z-index: 1;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--text);
  max-width: 52ch;
}

.panel__body .accent {
  color: var(--pine);
  font-weight: 600;
}

/* ---- Outro — fades in when is-outro class is set ---- */
.proc-outro {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 22px;
  opacity: 0;
  transform: translateY(36px) scale(.98);
  pointer-events: none;
  transition: opacity .7s var(--proc-ease), transform .7s var(--proc-ease);
}

/* When outro is active, fade out header + grid, fade in outro */
.process.is-outro .proc-head,
.process.is-outro .proc-grid {
  opacity: 0;
  transform: translateY(-26px);
  pointer-events: none;
}

.process.is-outro .proc-outro {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.outro__logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.outro__mark {
  width: 52px;
  height: 52px;
  color: var(--pine);
}

.outro__wordmark {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.375rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
  color: var(--pine);
  line-height: 1;
}

.outro__rule {
  width: 64px;
  height: 2px;
  background: var(--rust);
  border-radius: 2px;
}

.outro__tag {
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: clamp(1.375rem, 3.2vw, 2.375rem);
  color: var(--rust-dark);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.outro__slogan {
  font-size: clamp(0.9375rem, 1.5vw, 1.1875rem);
  color: rgba(74, 94, 88, 0.85);
  max-width: 34ch;
  line-height: 1.5;
}

/* ---- CTA button in outro ---- */
.outro__cta {
  margin-top: 8px;
}

/* ---- Responsive — mobile: stacked layout ---- */
@media (max-width: 780px) {
  .stage__inner {
    height: min(640px, 88%);
    gap: 22px;
  }

  .proc-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .proc-count { order: -1; }

  .proc-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 26px;
  }

  /* Horizontal rail on mobile */
  .rail { display: block; }

  .rail__track {
    left: 20px; right: 20px;
    top: 19px; bottom: auto;
    width: auto; height: 2px;
  }

  .rail__fill {
    inset: 0 auto 0 0;
    height: 100%;
    width: calc(var(--p) * 100%);
    transition: width .12s linear;
  }

  .rail__nodes {
    flex-direction: row;
    justify-content: space-between;
  }

  .node {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    width: 40px;
  }

  .node__label {
    font-size: 0.6875rem;
    line-height: 1.15;
    width: 72px;
    margin-left: -16px;
  }

  .panel__bignum {
    font-size: clamp(120px, 38vw, 220px);
    top: auto; bottom: 0; right: -2%;
  }

  .panel__icon { width: 52px; height: 52px; border-radius: 13px; }
  .panel__icon svg { width: 26px; height: 26px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .panel,
  .proc-head,
  .proc-grid,
  .proc-outro,
  .node__dot,
  .node__label,
  .rail__fill {
    transition-duration: .01ms;
  }
}


/* ============================================================
   SERVICES EXPLORER — two-pane tab layout
   ============================================================ */

/* Button arrow — animated on hover */
.btn-arrow {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}
.btn:hover .btn-arrow { transform: translateX(5px); }

/* Remove top padding when a section directly follows the page hero */
.section--flush-top { padding-top: 0; }

/* ---- Services hero — two-column layout ---- */
.services-hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start; /* tops aligned — prevents card from floating above headline */
}

/* ---- Lead card (right column) ---- */
.services-lead-card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rust); /* rust accent — editorial "flagged" look */
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 2px 10px rgba(21,64,58,.05), 0 8px 28px rgba(21,64,58,.07);
}

.services-lead-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(21,64,58,.08), 0 18px 44px rgba(21,64,58,.12);
}

.services-lead-body {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Small rust pill badge at top of card */
.services-lead-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.28em 0.85em;
  background-color: rgba(176, 85, 22, 0.08);
  border: 1px solid rgba(176, 85, 22, 0.22);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--rust-dark);
  letter-spacing: 0.06em;
  align-self: flex-start;
}

.services-lead-badge svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.services-lead-text {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
}

.services-lead-note {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--rust-dark);
  opacity: 0.72;
  letter-spacing: 0.05em;
}

/* Stacks on mobile */
@media (max-width: 768px) {
  .services-hero-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ---- Explorer shell ---- */
.explorer {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) 1.15fr;
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}

/* ---- Left: tab list ---- */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 92px;
}

.exp-tab {
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 18px 20px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text);
  transition: background-color 0.3s var(--ease),
              border-color 0.3s var(--ease),
              transform 0.3s var(--ease);
}

.exp-tab:hover         { background: var(--ivory); }
.exp-tab:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }

.exp-tab-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--rust-dark);
}

.exp-tab-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.exp-tab-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.exp-tab-tag {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exp-tab-arrow {
  color: var(--pine-soft);
  font-size: 1rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.exp-tab:hover .exp-tab-arrow { opacity: 1; transform: none; }

/* Active tab state */
.exp-tab.is-active {
  background: var(--pine);
  border-color: var(--pine);
}

.exp-tab.is-active .exp-tab-num   { color: var(--rust-light); }
.exp-tab.is-active .exp-tab-name  { color: var(--ivory); }
.exp-tab.is-active .exp-tab-tag   { color: var(--pine-soft2); }
.exp-tab.is-active .exp-tab-arrow { opacity: 1; transform: none; color: var(--ivory); }

/* ---- Right: detail panel ---- */
.exp-detail {
  position: relative;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(30px, 4vw, 56px);
  min-height: 440px;
  overflow: hidden;
}

.exp-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.exp-panel[hidden] { display: none; }

.exp-panel.is-active { animation: expIn 0.5s var(--ease) both; }

@keyframes expIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Ghost number behind panel */
.exp-bignum {
  position: absolute;
  top: clamp(10px, 2vw, 26px);
  right: clamp(16px, 3vw, 40px);
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: clamp(110px, 16vw, 200px);
  line-height: 1;
  color: var(--pine);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}

/* Icon block */
.exp-icon {
  display: grid;
  place-items: center;
  width: clamp(64px, 7vw, 84px);
  height: clamp(64px, 7vw, 84px);
  border-radius: 20px;
  background: var(--pine);
  color: var(--pine-soft);
  margin-bottom: 26px;
  flex-shrink: 0;
}

.exp-icon svg { width: 52%; height: 52%; }

/* Panel text hierarchy */
.exp-panel-num {
  font-family: var(--font-mono);
  font-size: 0.84375rem;
  letter-spacing: 0.05em;
  color: var(--rust-dark);
}

.exp-panel-title {
  margin-top: 12px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.05;
}

.exp-panel-tag {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-soft);
}

.exp-panel-text {
  margin-top: 22px;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.7;
  max-width: 54ch;
  color: var(--text);
}

.exp-panel-cta { margin-top: 32px; }

/* ---- Responsive: stacked on mobile ---- */
@media (max-width: 860px) {
  .explorer { grid-template-columns: 1fr; }

  .exp-list {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .exp-tab {
    grid-template-columns: auto auto;
    min-width: max-content;
    padding: 12px 16px;
  }

  .exp-tab-tag,
  .exp-tab-arrow { display: none; }

  .exp-tab-label  { flex-direction: row; align-items: center; gap: 8px; }
  .exp-detail     { min-height: 0; }
  .exp-bignum     { font-size: 7.5rem; }
}

@media (max-width: 480px) {
  .exp-tab-name { font-size: 0.9375rem; }
}


/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */

@media (max-width: 639px) {
  :root {
    --container-pad: 1rem;
  }

  .btn-group {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Keep centred btn-groups centred on mobile */
  .btn-group.text-center {
    align-items: center;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }
}
