/* ==========================================================================
   Adage Digital — shared site style.css
   Used across: landing, services, projects, clients, contact pages.
   Shared rules apply everywhere; page-specific rules are grouped and
   labelled below but harmless to include on pages that don't use them.
   ========================================================================== */

:root {
  --teal: #147B62;
  --teal-dark: #0B4739;
  --lime: #84CC16;
  --lime-soft: #22C55E;
  --ink: #0F172A;
  --paper: #FAFAFA;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 10px;
}

.font-display {
  font-family: 'Bricolage Grotesque', sans-serif;
}

.font-mono {
  font-family: 'IBM Plex Mono', monospace;
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lime-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

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


/* ==========================================================================
   PRELOADER (all pages)
   Two-half "curtain" background, a breathing glow behind the logo, a
   clip-path wipe that reveals the logo in sync with load progress, a
   one-shot shine sweep, and a curtain-split exit reveal.
   ========================================================================== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow: hidden;
  /* background: var(--ink); */
}

.pre-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  /* background:var(--ink); */
  background: white;
  z-index: 1;
}

.pre-half-left {
  left: 0;
}

.pre-half-right {
  right: 0;
}

.pre-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.pre-particle {
  position: absolute;
  bottom: -10px;
  left: 0;
  border-radius: 999px;
  background: var(--lime-soft);
  opacity: 0;
  animation: pre-rise linear infinite;
}

@keyframes pre-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }

  12% {
    opacity: 0.65;
  }

  88% {
    opacity: 0.35;
  }

  100% {
    transform: translateY(-100vh) scale(0.4);
    opacity: 0;
  }
}

.pre-center {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.25rem;
}

.pre-glow {
  position: absolute;
  width: min(70vw, 420px);
  height: min(70vw, 420px);
  border-radius: 999px;
  /* background: radial-gradient(circle, rgba(34,197,94,0.30), rgba(20,123,98,0.12) 45%, transparent 72%); */
  filter: blur(6px);
  animation: pre-breathe 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pre-breathe {

  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.pre-logo-wrap {
  position: relative;
  width: min(58vw, 280px);
  overflow: hidden;
  z-index: 1;
}

.pre-logo {
  display: block;
  width: 100%;
  height: auto;
  clip-path: inset(0 100% 0 0);
  /* filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.4)); */
  transform-origin: center;
}

.pre-logo-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  /* background: linear-gradient(115deg, transparent, rgba(255,255,255,0.6), transparent); */
  transform: skewX(-20deg);
  opacity: 0;
  pointer-events: none;
}

.pre-logo-wrap.shine::after {
  animation: pre-shine 0.85s ease-out;
}

@keyframes pre-shine {
  0% {
    left: -60%;
    opacity: 0;
  }

  18% {
    opacity: 0.9;
  }

  100% {
    left: 130%;
    opacity: 0;
  }
}

.pre-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.pre-counter {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--lime);
  font-size: 0.95rem;
  letter-spacing: 0.3em;
}

.pre-bar-track {
  width: min(220px, 50vw);
  height: 2px;
  background: rgba(250, 250, 250, 0.15);
  overflow: hidden;
  border-radius: 2px;
}

.pre-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--lime-soft));
}


/* ==========================================================================
   TEXT REVEAL / HERO (all pages)
   ========================================================================== */
.split-line {
  overflow: hidden;
}

.word,
.char {
  will-change: transform;
}

/* Signature loop underline - echoes the infinity swirl in the Adage mark */
.loop-underline {
  position: relative;
  display: inline-block;
}

.loop-underline svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.18em;
  width: 100%;
  height: auto;
  overflow: visible;
}

.loop-path {
  fill: none;
  stroke: var(--lime-soft);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
}

.hero-shape-float {
  animation: floaty 5s ease-in-out infinite;
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-14px);
  }
}


/* ==========================================================================
   NAVIGATION (all pages)
   ========================================================================== */
.glass-nav {
  background: rgba(250, 250, 250, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1.5px;
  width: 0%;
  background: var(--lime-soft);
  transition: width .3s ease;
}

.nav-link:hover::after,
.nav-link.current::after {
  width: 100%;
}

/* Mobile slide-over menu */
#mobileMenu {
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.19, 1, .22, 1);
}

#mobileMenu.open {
  transform: translateX(0%);
}


/* ==========================================================================
   BUTTONS (all pages)
   ========================================================================== */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}

.btn-shine:hover::before {
  left: 125%;
}


/* ==========================================================================
   MARQUEE TICKER (landing, clients pages)
   ========================================================================== */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.marquee-track.reverse {
  animation-direction: reverse;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(15, 23, 42, 0.1);
  white-space: nowrap;
}

.dark-section .marquee-chip {
  color: rgba(250, 250, 250, 0.5);
  border-color: rgba(250, 250, 250, 0.14);
}


/* ==========================================================================
   DARK SECTIONS + STATS + GRAIN TEXTURE (all pages)
   ========================================================================== */
.dark-section {
  background: var(--ink);
  color: var(--paper);
}

.stat-num {
  font-variant-numeric: tabular-nums;
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ==========================================================================
   CARDS — service / project / client / contact
   (shared hover-glow pattern used on landing, services, projects, clients, contact)
   ========================================================================== */
.service-card,
.project-card,
.client-card,
.contact-card {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  transition: transform .45s cubic-bezier(.19, 1, .22, 1), border-color .3s ease, box-shadow .45s ease;
}

.service-card:hover,
.project-card:hover,
.client-card:hover,
.contact-card:hover {
  transform: translateY(-8px);
  border-color: rgba(20, 123, 98, 0.35);
  box-shadow: 0 30px 60px -20px rgba(11, 71, 57, 0.25);
}

.service-card .card-glow,
.project-card .card-glow,
.client-card .card-glow,
.contact-card .card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(34, 197, 94, 0.10), transparent 40%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.service-card:hover .card-glow,
.project-card:hover .card-glow,
.client-card:hover .card-glow,
.contact-card:hover .card-glow {
  opacity: 1;
}

.client-mark {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
}

/* Brand logo wall — two-row auto-scrolling marquee (clients page) */
.logo-wrap {
  position: relative;
}

.logo-wrap::before,
.logo-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}

.logo-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--paper), transparent);
}

.logo-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--paper), transparent);
}

.logo-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.logo-track.reverse {
  animation-direction: reverse;
}

.logo-wrap:hover .logo-track {
  animation-play-state: paused;
}

.logo-card {
  flex-shrink: 0;
  width: 180px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  padding: 1.1rem 1.4rem;
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter .35s ease, opacity .35s ease, border-color .35s ease, transform .35s ease, box-shadow .35s ease;
}

.logo-card:hover {
  filter: grayscale(0);
  opacity: 1;
  border-color: rgba(20, 123, 98, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(11, 71, 57, 0.25);
}

.logo-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Project visual thumbnail (projects page) */
.project-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.project-card:hover .project-visual i {
  transform: scale(1.12) rotate(-4deg);
}

.project-visual i {
  transition: transform .5s cubic-bezier(.19, 1, .22, 1);
}


/* ==========================================================================
   FILTER / JUMP PILLS (projects, clients, services pages)
   ========================================================================== */
.filter-pill,
.jump-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(15, 23, 42, 0.12);
  transition: all .25s ease;
  white-space: nowrap;
}

.filter-pill.active,
.jump-pill.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.filter-pill:not(.active):hover,
.jump-pill:not(.active):hover {
  border-color: rgba(20, 123, 98, 0.5);
  color: var(--teal);
}


/* ==========================================================================
   PROJECT DETAIL MODAL (projects page)
   ========================================================================== */
#projectModal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

#projectModal.open {
  opacity: 1;
  pointer-events: auto;
}

#projectModal .modal-panel {
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: transform .35s cubic-bezier(.19, 1, .22, 1), opacity .35s ease;
}

#projectModal.open .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}


/* ==========================================================================
   TESTIMONIAL CAROUSEL (clients page)
   ========================================================================== */
.testi-track {
  display: flex;
  transition: transform .6s cubic-bezier(.19, 1, .22, 1);
}

.testi-slide {
  flex: 0 0 100%;
}

.testi-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.15);
  transition: background .3s ease, width .3s ease;
}

.testi-dot.active {
  background: var(--teal);
  width: 22px;
}


/* ==========================================================================
   SERVICES PAGE — detail rows + process timeline + FAQ
   ========================================================================== */
.service-row {
  scroll-margin-top: 100px;
}

.service-icon-panel {
  position: relative;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-50, #EAF6F2);
  border-radius: 1.5rem;
  overflow: hidden;
}

.service-icon-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.check-item i {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Process timeline */
.process-step {
  position: relative;
}

.process-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  -webkit-text-stroke: 1.5px rgba(250, 250, 250, 0.35);
  color: transparent;
}

.process-line {
  position: absolute;
  top: 2.75rem;
  left: 1.75rem;
  bottom: -2.5rem;
  width: 1px;
  background: rgba(250, 250, 250, 0.14);
}

.process-step:last-child .process-line {
  display: none;
}

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.faq-question {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

.faq-chevron {
  transition: transform .35s cubic-bezier(.19, 1, .22, 1);
  flex-shrink: 0;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, opacity .3s ease, margin .3s ease;
  opacity: 0;
}

.faq-item.open .faq-answer {
  opacity: 1;
}


/* ==========================================================================
   CONTACT PAGE — form fields + map + toast
   ========================================================================== */
.form-field {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.85rem;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.form-field:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 123, 98, 0.1);
}

.form-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.5);
  margin-bottom: 0.5rem;
  display: block;
}

.service-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  transition: all .2s ease;
  cursor: pointer;
}

.service-chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.service-chip:not(.active):hover {
  border-color: rgba(20, 123, 98, 0.5);
  color: var(--teal);
}

.map-frame {
  filter: grayscale(0.15) contrast(1.02);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 1.5rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  z-index: 90;
  transition: transform .4s cubic-bezier(.19, 1, .22, 1);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
}