/* Infomex V-Kimi — Design tokens & components (per DESIGN-BRIEF.md) */

:root {
  --brand-green: #47B475;
  --brand-green-dark: #398F5D;
  --brand-green-text: #2F7A4E;
  --brand-mint: #8ED3AB;
  --brand-mist: #EAF6EF;
  --ink: #292929;
  --slate: #5C6670;
  --silver: #9AA3AB;
  --cloud: #F5F6F7;
  --radius-btn: 999px;
  --radius-card: 16px;
  --radius-input: 12px;
  --shadow-card: 0 4px 16px rgba(41, 41, 41, 0.05);
  --shadow-card-hover: 0 12px 32px rgba(41, 41, 41, 0.1);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.18);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--slate);
  background: #fff;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--ink);
}

.section-title {
  font-size: clamp(2.125rem, 4.5vw, 3.125rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.font-mono-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

/* Hero backgrounds */
.hero-canvas,
.hero-wave-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--brand-green);
  margin-left: 4px;
  vertical-align: -0.1em;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Trust strip */
.trust-strip {
  background-color: rgba(245, 246, 247, 0.6);
}

@media (max-width: 767px) {
  .trust-strip p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
  }
}

/* Site header */
.site-header {
  transition: padding 0.3s var(--ease-out);
}

.site-header-inner {
  transition: padding 0.3s var(--ease-out);
}

.site-header-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
}

@media (min-width: 768px) {
  .site-header-brand {
    min-height: 3.5rem;
  }
}

.site-logo-link {
  display: inline-flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s var(--ease-out);
}

.site-logo-link.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-logo {
  height: 3rem;
  width: auto;
  transition: height 0.3s var(--ease-out);
}

@media (min-width: 768px) {
  .site-logo {
    height: 3.5rem;
  }
}

.site-header.is-scrolled .site-logo {
  height: 2rem;
}

@media (min-width: 768px) {
  .site-header.is-scrolled .site-logo {
    height: 2.5rem;
  }
}

/* Hero scroll link */
/* Hero loading — original audioWave animation */
.hero-loader {
  margin: 0 auto;
}

.loader--audioWave {
  width: 10.4em;
  height: 3em;
  background:
    linear-gradient(var(--brand-green), var(--brand-green)) 0 50%,
    linear-gradient(var(--brand-green), var(--brand-green)) 1.6em 50%,
    linear-gradient(var(--brand-green), var(--brand-green)) 3.2em 50%,
    linear-gradient(var(--brand-green), var(--brand-green)) 4.8em 50%,
    linear-gradient(var(--brand-green), var(--brand-green)) 6.4em 50%,
    linear-gradient(var(--brand-green), var(--brand-green)) 8em 50%,
    linear-gradient(var(--brand-green), var(--brand-green)) 9.6em 50%;
  background-repeat: no-repeat;
  background-size:
    0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em,
    0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em;
  animation: audioWave 1.5s linear infinite;
}

@keyframes audioWave {
  25% {
    background-size:
      0.8em 3em, 0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em,
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em;
  }
  37.5% {
    background-size:
      0.8em 0.375em, 0.8em 3em, 0.8em 0.375em, 0.8em 0.375em,
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em;
  }
  50% {
    background-size:
      0.8em 0.375em, 0.8em 0.375em, 0.8em 3em, 0.8em 0.375em,
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em;
  }
  62.5% {
    background-size:
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em, 0.8em 3em,
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em;
  }
  75% {
    background-size:
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em,
      0.8em 3em, 0.8em 0.375em, 0.8em 0.375em;
  }
  87.5% {
    background-size:
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em,
      0.8em 0.375em, 0.8em 3em, 0.8em 0.375em;
  }
  100% {
    background-size:
      0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em, 0.8em 0.375em,
      0.8em 0.375em, 0.8em 0.375em, 0.8em 3em;
  }
}

.hero-scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-green-text);
  opacity: 0.6;
  text-decoration: none;
  transition: color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.hero-scroll-link:hover {
  color: var(--brand-green-dark);
  opacity: 0.9;
}

.hero-scroll-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  font-size: 0.75rem;
  line-height: 1;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

/* Buttons — fully rounded pills per original site */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  font-weight: 500;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
  cursor: pointer;
}

.btn-pill[data-open-modal],
#contact-form button[type="submit"] {
  text-transform: uppercase;
}

.btn-primary {
  background: var(--brand-green);
  color: #fff;
  border: 2px solid var(--brand-green);
}

.btn-primary:hover {
  background: var(--brand-green-dark);
  border-color: var(--brand-green-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--brand-green);
  color: var(--brand-green);
}

.btn-outline:hover {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}

/* Button arrow animation — identical to original site: 0.2s ease, +15px gap on hover, reverses on mouse-leave.
   min-width reserves the expansion room (like the original's min-width: 250px), so the button never
   grows — text and arrow re-center within the fixed width, both moving as the gap opens. */
.btn-pill .btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s ease 0s;
}

.btn-pill .btn-arrow::before {
  display: block;
}

.btn-pill:hover .btn-arrow {
  padding-left: 15px;
}

/* Full-width submit — reserve arrow travel so label + icon stay centred */
#contact-form button[type="submit"] .btn-arrow {
  margin-left: 10px;
  padding-right: 15px;
  position: relative;
  top: 1px;
}

#contact-form button[type="submit"]:hover .btn-arrow {
  padding-right: 0;
}

/* Fixed CTA widths — reserve the arrow's 15px travel so hover never expands the button */
.btn-fixed {
  min-width: 230px;
}

.btn-fixed-sm {
  min-width: 190px;
}

/* Nav links */
.nav-link {
  position: relative;
  color: var(--slate);
  transition: color 0.2s var(--ease-out);
}

.nav-link:hover {
  color: var(--brand-green-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-green);
  transition: width 0.2s var(--ease-out);
}

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

/* Service icons — Bootstrap Icons, no background tile, understated */
.service-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand-green);
}

/* Service cards */
.service-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  column-gap: 1.25rem;
  row-gap: 0.75rem;
  background: transparent;
  border: 1px solid #E8EAEC;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.service-card.fade-in {
  transition:
    opacity 0.8s ease,
    transform 0.8s ease,
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}

.service-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(71, 180, 117, 0.35);
}

.service-card-title {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
  line-height: 1.3;
}

.service-card-num {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  font-size: 0.9375rem;
  line-height: 1.3;
  padding-top: 0.1em;
}

.service-card-desc {
  grid-column: 1;
  grid-row: 2;
}

.service-card-icon {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  opacity: 0.6;
}

/* Value cards (Why Infomex) */
.value-card {
  background: transparent;
  border: 1px solid rgba(71, 180, 117, 0.35);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
}

#why,
.bg-why {
  background-color: #EBEEF1;
}

/* Icon tiles */
.value-icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--brand-green);
  opacity: 0.8;
}

.cta-sep {
  opacity: 0.55;
  line-height: 1;
}

.modal-backdrop {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.56s var(--ease-out), visibility 0.56s var(--ease-out);
}

.modal-backdrop.active,
.modal-backdrop.is-closing {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop.is-closing {
  opacity: 0;
}

.modal-panel {
  transform: translateY(calc(-100% - 2rem));
  opacity: 0;
  transition: transform 0.56s var(--ease-out), opacity 0.56s var(--ease-out);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  will-change: transform, opacity;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.5rem;
}

.modal-close {
  flex-shrink: 0;
  line-height: 0;
}

.modal-intro {
  padding: 0 1.5rem 1rem;
}

.modal-form-area {
  background: var(--cloud);
  padding: 1.5rem;
}

/* Floating labels — wholesale-style, pinned top-left, no animation */
#contact-form .form-floating {
  position: relative;
}

#contact-form .form-floating > .form-control {
  display: block;
  width: 100%;
  padding: 1.875rem 1rem 0.625rem;
  background: #fff;
  border-width: 2px;
  border-style: solid;
  border-color: #E5E7EB;
  border-radius: var(--radius-input);
  box-shadow: none;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--ink);
  transition: border-color 0.45s var(--ease-out);
}

#contact-form .form-floating > textarea.form-control {
  min-height: 7.5rem;
  resize: none;
}

#contact-form .form-floating > .form-control:focus,
#contact-form .form-floating > .form-control:focus-visible {
  outline: none;
  border-color: rgba(71, 180, 117, 0.5);
  box-shadow: none;
}

#contact-form .form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
  padding: 1.25rem 1rem 0.5rem;
  pointer-events: none;
  border: 0;
  transform-origin: 0 0;
  opacity: 0.65;
  transform: scale(0.85) translateY(-0.35rem) translateX(0.15rem);
  color: var(--slate);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  transition: none;
}

#contact-form .form-floating > .form-control:not(:placeholder-shown) ~ label,
#contact-form .form-floating > .form-control:-webkit-autofill ~ label,
#contact-form .form-floating.has-value > label {
  opacity: 0.48;
  color: var(--slate);
}

.modal-backdrop.active:not(.is-closing) .modal-panel {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop.is-closing .modal-panel {
  transform: translateY(calc(100vh - 1rem));
  opacity: 0;
}

/* Scroll reveal */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Services cards — Sugarfix-style fade-up with stagger */
#services .service-card.fade-in {
  transform: translateY(30px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease,
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}

#services .service-card.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

#services .service-card.fade-in:nth-child(1) { transition-delay: 0ms; }
#services .service-card.fade-in:nth-child(2) { transition-delay: 80ms; }
#services .service-card.fade-in:nth-child(3) { transition-delay: 160ms; }
#services .service-card.fade-in:nth-child(4) { transition-delay: 240ms; }
#services .service-card.fade-in:nth-child(5) { transition-delay: 320ms; }
#services .service-card.fade-in:nth-child(6) { transition-delay: 400ms; }

/* Form feedback */
.form-feedback {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-input);
  font-size: 0.875rem;
}

.form-feedback.success {
  display: block;
  background: var(--brand-mist);
  color: var(--brand-green-text);
  border: 1px solid var(--brand-mint);
}

.form-feedback.error {
  display: block;
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Section scroll nav */
.section-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

.section-nav-menu {
  position: relative;
  display: flex;
  gap: 0.125rem;
  align-items: center;
  background: #fff;
  padding: 0.25rem;
  border-radius: var(--radius-btn);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #E8EAEC;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s var(--ease-out);
}

.section-nav.is-visible {
  pointer-events: auto;
}

.section-nav.is-visible .section-nav-menu {
  opacity: 0.9;
  visibility: visible;
  pointer-events: auto;
}

.section-nav-indicator {
  position: absolute;
  top: 0.25rem;
  left: 0;
  width: 0;
  height: calc(100% - 0.5rem);
  background: var(--brand-green);
  border-radius: var(--radius-btn);
  transition: left 0.3s var(--ease-out), width 0.3s var(--ease-out);
  z-index: 0;
  pointer-events: none;
}

.section-nav a {
  position: relative;
  z-index: 1;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-btn);
  color: var(--slate);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
  white-space: nowrap;
}

.section-nav a.active {
  color: #fff;
}

.section-nav a:hover:not(.active) {
  color: var(--brand-text);
}

.section-nav-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #E8EAEC;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: var(--slate);
  font-size: 1.125rem;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s var(--ease-out), bottom 0.3s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

body.is-at-footer .section-nav-top {
  opacity: 0.9;
  visibility: visible;
  pointer-events: auto;
}

.section-nav-top:hover {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}

/* CTA — animated grey waves at bottom half only */
#cta {
  background: #EBEEF1;
  overflow: hidden;
  position: relative;
}

.cta-wave-svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
}

#cta .cta-content p,
#cta .cta-content p span {
  color: var(--slate);
}

/* Terminal code section */
#code {
  background-color: rgba(41, 41, 41, 0.9);
}

.terminal-window {
  background: #1E1E1E;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot--red { background: #FF5F57; opacity: 0.85; }
.terminal-dot--amber { background: #FEBC2E; opacity: 0.85; }
.terminal-dot--green { background: #28C840; opacity: 0.85; }

.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--silver);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
}

.terminal-body pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #C7CDD3;
  white-space: pre;
  min-height: 0;
}

.tok-kw { color: #47B475; }
.tok-str { color: #8ED3AB; }
.tok-var { color: #E8EAEC; }
.tok-fn { color: #82AAFF; }
.tok-com { color: #9AA3AB; }

.code-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--brand-green);
  margin-left: 1px;
  vertical-align: -0.15em;
  animation: blink 0.8s step-end infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer */
.site-footer {
  background: #1e1e1e;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
}

@media (min-width: 768px) {
  .footer-brand {
    justify-content: flex-start;
    width: auto;
  }
}

.footer-spinner {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  opacity: 0.6;
  animation: footer-spinner-spin 18s linear infinite;
}

.footer-logo {
  display: block;
  height: 1rem;
  width: auto;
  flex-shrink: 0;
  opacity: 0.5;
}

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

.site-footer .copyright {
  color: rgba(255, 255, 255, 0.3);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  #services .service-card.fade-in { transition-delay: 0ms; }
  .typewriter-cursor { animation: none; }
  .code-cursor { animation: none; }
  .service-card, .value-card, .btn-pill, .btn-pill .btn-arrow, .nav-link, .nav-link::after, .section-nav-indicator, .section-nav-menu, .section-nav-top, .site-logo, .site-logo-link, .site-header-inner, .section-nav, .modal-backdrop, .modal-panel { transition: none; }
  .modal-panel { transform: none; opacity: 1; }
  .section-nav-menu { opacity: 0.9; visibility: visible; }
  .footer-spinner { animation: none; }
  .loader--audioWave { animation: none; }
}
