/* ==========================================================================
   1. Variables
   ========================================================================== */
:root {
  --bs-primary: #00718F;
  --bs-primary-rgb: 0, 113, 143;
  --bs-primary-darker: #016885;
  --brand-primary-deep: #005F69;      /* fill colour for the solid button sweep */

  --bs-lightest: #F7F7F7;
  --bs-light: #EEEEEE;
  --bs-medium: #656565;
  --bs-darker: #454545;
  --bs-dark: #202020;

  --bs-body-font-family: 'Urbanist', sans-serif;
  --bs-body-font-weight: 400;
  --bs-body-color: var(--bs-medium);
  --bs-link-color: #00718F;
  --bs-link-hover-color: #016885;
}

/* Styles text selection globally */

::search-text,
::selection {
  background-color: var(--bs-primary);
  color: var(--bs-lightest);
}

.faq-heading{
  font-weight: 400; 
  color: var(--bs-dark);
  font-family: 'Rokkitt', serif;
  line-height: 130%;
  letter-spacing: 0.01em;
}

#case-studies h3{ color: var(--bs-darker); }

/* ==========================================================================
   2. Base & typography
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--bs-body-font-family);
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--bs-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Rokkitt', serif;
  line-height: 130%;
  letter-spacing: 0.01em;
}

h1, h6 { font-weight: 300; }
h2, h3 { font-weight: 400; }
h4, h5 { font-weight: 600; }

@media screen and (width >= 1200px) {
  h1 { font-size: 4rem; }
}

@media screen and (width >= 468px){ 
  .faq-heading{font-size: 1.25rem;}
}

.highlight { color: var(--bs-primary); }
.logo      { max-width: 200px; }


/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.cta-group { gap: 1rem; }

.slot {
  border-left: 1px solid #fff;
  min-height: 250px;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

/* 4a. Brand colours (other variants use Bootstrap's defaults) */
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-border-color: var(--brand-primary-deep); /* also the sweep colour */
  --bs-btn-active-bg: var(--bs-primary-darker);
  --bs-btn-active-border-color: var(--bs-primary-darker);
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-border-color: var(--bs-primary);          /* also the sweep colour */
  --bs-btn-active-bg: var(--bs-primary-darker);
  --bs-btn-active-border-color: var(--bs-primary-darker);
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

/* 4b. Shared shape + sweep (every button except .btn-link) */
.btn:not(.btn-link) {
  --bs-btn-border-radius: 0;
  --bs-btn-border-width: 2px;
  --bs-btn-padding-x: 1.75rem;
  --bs-btn-padding-y: 0.8rem;
  --bs-btn-font-weight: 600;
  --bs-btn-hover-bg: var(--bs-btn-bg);   /* keep bg steady; the sweep does the work */

  position: relative;
  overflow: hidden;
  isolation: isolate;                    /* sweep sits above bg, below text */
  transition: color 0.4s ease-in-out,
              border-color 0.4s ease-in-out,
              box-shadow 0.15s ease-in-out;
}

.btn:not(.btn-link)::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;                     /* top/bottom 0, left 0 */
  width: 0;
  z-index: -1;
  background: var(--bs-btn-hover-border-color);
  transition: width 0.4s ease-in-out;
}

.btn:not(.btn-link):hover::before,
.btn:not(.btn-link):focus-visible::before {
  width: 100%;
}

.btn:not(.btn-link):active::before {
  background: var(--bs-btn-active-bg);
}

.btn:hover { text-decoration: none; }

/* 4c. Link buttons keep their own styling */
/* 4c. Link buttons: animated underline */
.btn.btn-link {
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: underline solid transparent 2px;  /* hidden, but takes up space */
  text-underline-offset: 4px;
  transition: color 0.3s ease,
              text-decoration-color 0.3s ease;
}

.btn.btn-link:hover,
.btn.btn-link:focus-visible {
  text-decoration-color: currentColor;               /* fades the underline in */
}

/* ==========================================================================
   Text Links (default for all plain links)
   ========================================================================== */
a:not(.btn):not(:has(img, svg, div, button)) {
  color: var(--bs-primary);
  text-decoration: none;

  /* the "underline" is a 3px gradient bar that grows from 0 to 100% width */
  background-image: linear-gradient(var(--bs-primary), var(--bs-primary));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 3px;
  padding-bottom: 2px;                 /* small gap between text and bar */

  transition: background-size 500ms, color 0.3s ease;
}

a:not(.btn):not(:has(img, svg, div, button)):hover,
a:not(.btn):not(:has(img, svg, div, button)):focus-visible {
  color: var(--bs-primary-darker);
  text-decoration: none;
  background-size: 100% 3px;
}

@media (prefers-reduced-motion: reduce) {
  a:not(.btn):not(:has(img, svg, div, button)) { transition: none; }
}

/* ==========================================================================
   5. Footer
   ========================================================================== */
footer {
  border-top: 2px solid var(--bs-light);
}


/* ==========================================================================
   6. Timeline
   ========================================================================== */
.timeline {
  --tl-icon-size: 40px;
  --tl-gap: 8px;                    /* space between connector line and icon */
  --tl-line-color: var(--bs-light);
}

.timeline-item {
  position: relative;
  padding-left: calc(var(--tl-icon-size) + 1.5rem);
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Connector: from under this icon to just above the next one */
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--tl-icon-size) / 2);
  transform: translateX(-50%);
  top: calc(var(--tl-icon-size) + var(--tl-gap));
  bottom: var(--tl-gap);
  width: 2px;
  background: var(--tl-line-color);
}

.timeline-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tl-icon-size);
  height: var(--tl-icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--bs-primary);
  background: transparent;
}

.timeline-title {
  color: var(--bs-primary);
  min-height: var(--tl-icon-size);  /* centres title against the icon */
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 400;
}


/* ==========================================================================
   7. Accordion
   ========================================================================== */
.accordion {
  --bs-accordion-btn-bg: transparent;
  --bs-accordion-active-bg: var(--bs-lightest);
  --bs-accordion-active-color: var(--bs-dark);
  --bs-accordion-btn-color: var(--bs-medium);
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: var(--bs-light);
  --bs-accordion-btn-focus-box-shadow: none;
}

.accordion-header:hover  { background-color: var(--bs-lightest); }
.accordion-header:active { --bs-accordion-border-color: var(--bs-medium); }

.accordion-item{color: var(--bs-dark);}
/* ==========================================================================
   8. Stats
   ========================================================================== */
.stat {
  padding-left: 1.5rem;
}

.stat-number {
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;  /* stops jitter while counting */
  min-width: 3ch;                      /* reserves space, no layout shift */
}

.stat-label {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.stat-disclaimer {
  font-size: 1rem;
}


/* ==========================================================================
   9. Back-to-top button
   ========================================================================== */

.btn.back-to-top::before { display: none; }
.back-to-top {
  width: 50px;
  height: 50px;
  --bs-btn-border-radius: 50%;
  --bs-btn-padding-x: 0;
  --bs-btn-padding-y: 0;
    z-index: 2000;
  text-decoration: none;
  border: 2px solid var(--bs-lightest);

  /* Scroll-driven fade-in: starts at 50vh, fully visible by 70vh.
     Not supported in Firefox yet; the button is simply always visible there. */
  animation: fade-in linear both;
  animation-timeline: scroll();
  animation-range: 50vh 70vh;
}

.back-to-top:hover,
.back-to-top:active {
  background-color: var(--bs-primary-darker);
  border-color: var(--bs-primary-darker);
}

.back-to-top span {
  font-size: 24px;
  color: #fff;
  line-height: 0;
  font-weight: bold;
}

/* ==========================================================================
   10. Animations
   ========================================================================== */

@keyframes fade-in {
  from { opacity: 0; visibility: hidden;  transform: scale(0.5); }
  to   { opacity: 1; visibility: visible; transform: scale(1); }
}

/* Typewriter */
.type {
  display: inline-flex;
  /*color: var(--bs-primary);*/
}

.type span {
  word-break: break-all;
  height: 1.2em;
  width: 0;
  overflow: hidden;
  animation: typewriter 2s linear 1 forwards;
}

.type span::before {
  content: " ";
  display: inline-block;
}

@keyframes typewriter {
  90%, 100% { width: 100%; }
}

/* Image slide-in (add .active with JS / IntersectionObserver) */
/* Always applied: harmless without JS */

.reveal{
  max-width: 100%;
  height: auto;
}

.js .reveal{
  opacity: 0;
  transform: translateY(50px);
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
  will-change: transform, opacity;
}

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

/* Reading Progress Scrollbar */
 
.scrollbar-indicator {
  width: 100%;
  height: 4px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  transition: all 0.3s ease-in-out;
}
.scrollbar {
  height: 100%;
  background-color: var(--bs-primary);
  width: 0%;
}

.lead{color: var(--bs-dark); font-weight: 500;}

/* ==========================================================================
   11. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}