/* ==========================================================================
   Chrisentia Consultancy — site styles
   Single source of truth. Previously duplicated inline in all three pages.
   ========================================================================== */

/* --- Base ---------------------------------------------------------------- */

body {
  background: linear-gradient(135deg, #fafbfc 0%, #f0f4f8 50%, #e8f0f7 100%);
  min-height: 100vh;
}

section {
  position: relative;
}

section.bg-white {
  background: linear-gradient(180deg, #fafbfc 0%, #f5f8fb 100%);
}

section.bg-surface-dim {
  background: linear-gradient(180deg, #f0f4f8 0%, #e8f0f7 100%);
}

/* Visible keyboard focus. Previously missing entirely. */
:focus-visible {
  outline: 2px solid #2d3748;
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Scroll reveal ------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

.glass-panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(45, 55, 72, 0.08);
  box-shadow: 0 4px 6px rgba(45, 55, 72, 0.05);
}

.hover-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hover-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(45, 55, 72, 0.15);
}

.service-card {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover {
  transform: scale(1.03) translateY(-10px);
  box-shadow: 0 25px 50px -12px rgba(45, 55, 72, 0.25);
}

.project-card {
  background: linear-gradient(145deg, #fafbfc, #f5f8fb);
  border: 1px solid rgba(45, 55, 72, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(45, 55, 72, 0.15);
  border-color: rgba(45, 55, 72, 0.2);
}

.project-number {
  font-size: 5rem;
  line-height: 1;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px #2d3748;
  opacity: 0.1;
  position: absolute;
  top: -10px;
  right: 20px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.project-card:hover .project-number {
  opacity: 0.5;
  transform: scale(1.1);
}

/* --- Motion -------------------------------------------------------------- */

.kinetic-rotate {
  animation: slow-rotate 25s linear infinite;
}

@keyframes slow-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- Navigation ---------------------------------------------------------- */

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(90deg, #2d3748, #4a5568);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-link[aria-current="page"] {
  color: #1e293b;
  font-weight: 800;
}

#hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 10px;
}

#hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1e293b;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 767px) {
  #hamburger { display: flex; }
  #desktopLinks,
  #desktopContact { display: none !important; }
}

#mobileMenu {
  display: none;
  width: 100%;
  max-width: 80rem;
  margin-top: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(209, 213, 219, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  box-sizing: border-box;
}

#mobileMenu.open { display: block; }

#mobileMenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#mobileMenu ul li a {
  display: block;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
}

#mobileMenu ul li:last-child a { border-bottom: none; }
#mobileMenu ul li a:hover { color: #1e293b; }

#mobileContact {
  display: block;
  margin-top: 12px;
  text-align: center;
  background: linear-gradient(to right, #1e293b, #334155);
  color: white;
  padding: 10px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* --- Project media ------------------------------------------------------- */

.project-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1.75rem;
  overflow: hidden;
  background: #eef2f6;
  box-shadow: 0 10px 30px -12px rgba(45, 55, 72, 0.25);
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Single image gets a gentle zoom on hover. Video deliberately does not —
   the framing belongs to whoever shot it. */
.project-media--single img {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.group:hover .project-media--single img,
.project-media--single:hover img {
  transform: scale(1.04);
}

/* Carousel: all slides stacked, only the active one visible. */
.project-media--carousel img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.project-media--carousel img.is-active {
  opacity: 1;
}

.project-media__dots {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  z-index: 2;
}

.project-media__dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.3s ease, width 0.3s ease;
}

.project-media__dot.is-active {
  width: 1.5rem;
  background: #ffffff;
}

/* Shown when a project folder has no files in it yet. */
.project-media--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, #f5f8fb, #e8f0f7);
  border: 1px solid rgba(45, 55, 72, 0.08);
  text-align: center;
  padding: 2rem;
}

.project-media__index {
  font-size: 4rem;
  line-height: 1;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px #2d3748;
  opacity: 0.25;
}

.project-media__label {
  font-weight: 700;
  color: #64748b;
  max-width: 22ch;
}

/* Alternating two-column layout for the full project write-ups. */
.project-entry {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .project-entry {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .project-entry:nth-child(even) .project-entry__media {
    order: 2;
  }
}

.project-entry__number {
  font-size: 3rem;
  line-height: 1;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px #2d3748;
  opacity: 0.18;
  margin-bottom: 0.75rem;
}

.project-entry__body p + p {
  margin-top: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  background: rgba(45, 55, 72, 0.07);
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Software list under a service card. */
.service-tools {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(45, 55, 72, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

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

/* Separator dots are drawn between items rather than typed into the markup,
   so the spacing can be tuned without touching content. */

.badge-list {
  display: inline-flex;
  align-items: center;
}

.badge-list > span + span::before {
  content: '\2022';
  display: inline-block;
  margin: 0 0.7rem;
  color: rgba(45, 55, 72, 0.35);
  font-weight: 700;
}

/* --- Client logo marquee ------------------------------------------------- */

.logo-marquee {
  overflow: hidden;
  position: relative;
  /* Fade the edges so logos slide in and out rather than popping. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.logo-marquee__track {
  display: flex;
  align-items: center;
  gap: 6rem;
  width: max-content;
  animation: logo-scroll 55s linear infinite;
}

.logo-marquee:hover .logo-marquee__track,
.logo-marquee:focus-within .logo-marquee__track {
  animation-play-state: paused;
}

/* The track is rendered twice, so shifting by exactly half loops seamlessly. */
@keyframes logo-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.logo-marquee__item {
  flex: 0 0 auto;
  height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.logo-marquee__item img {
  max-height: 6rem;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo-marquee__item img:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Fallback tile for a client whose logo file isn't in yet. */
.logo-marquee__item--text span {
  display: inline-flex;
  align-items: center;
  height: 5rem;
  padding: 0 2rem;
  border: 1px solid rgba(45, 55, 72, 0.12);
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #475569;
  white-space: nowrap;
  background: #fafbfc;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.logo-marquee__item--text span:hover {
  border-color: rgba(45, 55, 72, 0.3);
  color: #1e293b;
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .logo-marquee__track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    gap: 2rem 3rem;
  }

  /* With no motion the duplicate track would just repeat every logo. */
  .logo-marquee__item[aria-hidden="true"] {
    display: none;
  }
}

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

.footer-link {
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #ffffff;
}

/* --- Reduced motion ------------------------------------------------------ */
/* Respects the OS setting. Without this, the reveal animation hides content
   from anyone who has motion turned off. */

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --- Why Chrisentia list ------------------------------------------------- */

.why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.why-list li {
  position: relative;
  padding-left: 1.9rem;
  color: #64748b;
  line-height: 1.5;
}

/* Tick drawn in CSS so it inherits colour and needs no icon font. */
.why-list li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.3rem;
  width: 0.45rem;
  height: 0.8rem;
  border: solid #2d3748;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0.7;
}

/* --- Stats band ---------------------------------------------------------- */

.stats-band {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .stats-band {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  /* Hairline dividers between columns, drawn rather than added as markup. */
  .stats-band .stat + .stat {
    border-left: 1px solid rgba(45, 55, 72, 0.1);
  }
}

.stat {
  padding: 0 1.5rem;
}

.stat__value {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
  color: #2d3748;
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.stat__suffix {
  color: #94a3b8;
}

.stat__label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

/* Each column lifts in as its counter starts, staggered by data-delay. */
.stat {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat.is-in {
  opacity: 1;
  transform: translateY(0);
}

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