/* ============================================================
   COMPONENTS - mlic.co
   ============================================================ */

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition: background var(--transition-base),
              border-color var(--transition-base),
              backdrop-filter var(--transition-base);
}

.header.scrolled {
  background: var(--color-header);
  backdrop-filter: var(--blur-nav);
  -webkit-backdrop-filter: var(--blur-nav);
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-header);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  z-index: 1001;
  transition: opacity var(--transition-fast);
}
.logo img {
  display: block;
  height: 42px;
  width: auto;
}
.theme-logo {
  filter: var(--theme-logo-filter);
  transition: filter 0.28s var(--ease-premium);
}
.logo:hover { opacity: 0.65; }

.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: var(--font-size-sm);
  font-weight: 400;
  /* Slightly dimmed white - exact match to mockup inactive links */
  color: rgba(var(--theme-fg-rgb), 0.65);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

/* Active underline indicator - small centered tick below the link */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1.5px;
  background: var(--theme-fg);
  border-radius: 2px;
  transition: width var(--transition-base);
}

.nav-link:hover { color: var(--theme-fg); }

/* Active: short centered dash in the accent colour - matches mockup Home indicator */
.nav-link.active {
  color: var(--theme-fg);
}
.nav-link.active::after {
  width: 18px;
}
.nav-link:hover::after {
  width: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  z-index: 1001;
}

.header-cta { z-index: 1001; }

/* ---- Theme control ---- */
.theme-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  background: rgba(var(--theme-fg-rgb), 0.05);
  transition:
    border-color 0.28s var(--ease-premium),
    background 0.28s var(--ease-premium),
    transform 0.28s var(--ease-premium);
}

.theme-toggle:hover {
  border-color: var(--color-text-muted);
  background: rgba(var(--theme-fg-rgb), 0.09);
  transform: translateY(-1px);
}

.theme-toggle:active { transform: translateY(0) scale(0.97); }

.theme-toggle:focus-visible {
  outline: 2px solid rgba(var(--theme-fg-rgb), 0.45);
  outline-offset: 3px;
}

.theme-toggle-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.theme-toggle-track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: translateX(20px);
  transition: transform 0.34s var(--ease-premium), background 0.28s var(--ease-premium);
}

html[data-theme="light"] .theme-toggle-track::before {
  transform: translateX(0);
}

.theme-toggle-symbol {
  position: relative;
  z-index: 1;
  width: 14px;
  font-size: 0.75rem;
  line-height: 1;
  text-align: center;
  transition: color 0.28s var(--ease-premium), transform 0.34s var(--ease-premium);
}

.theme-toggle-sun { color: var(--theme-bg); }
.theme-toggle-moon { color: var(--theme-bg); transform: rotate(-12deg); }
html[data-theme="dark"] .theme-toggle-sun { color: var(--color-text-secondary); transform: rotate(35deg); }
html[data-theme="light"] .theme-toggle-moon { color: var(--color-text-secondary); transform: rotate(20deg); }

.mobile-theme-control {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.25rem;
  padding: 0.65rem 0.8rem 0.65rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(var(--theme-fg-rgb), 0.035);
  opacity: 0;
  transform: translateY(18px);
}

.mobile-theme-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ---- Mobile menu ---- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base);
  transform-origin: center;
}

.menu-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-mobile-nav);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.mobile-nav.open { display: flex; }

.mobile-nav-link {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 600;
  opacity: 0;
  transform: translateY(24px);
  letter-spacing: var(--letter-spacing-tight);
}

.mobile-nav.open .mobile-nav-link {
  animation: mobileNavIn 0.55s var(--ease-premium) forwards;
}
.mobile-nav.open .mobile-nav-link:nth-child(1) { animation-delay: 0.08s; }
.mobile-nav.open .mobile-nav-link:nth-child(2) { animation-delay: 0.14s; }
.mobile-nav.open .mobile-nav-link:nth-child(3) { animation-delay: 0.20s; }
.mobile-nav.open .mobile-nav-link:nth-child(4) { animation-delay: 0.26s; }
.mobile-nav.open .mobile-nav-link:nth-child(5) { animation-delay: 0.32s; }
.mobile-nav.open .mobile-nav-link:nth-child(6) { animation-delay: 0.38s; }
.mobile-nav.open .mobile-theme-control {
  animation: mobileNavIn 0.55s 0.44s var(--ease-premium) forwards;
}

@keyframes mobileNavIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
  .nav, .header-cta { display: none; }
  .header-actions { margin-left: auto; }
  .menu-toggle { display: flex; }
  .menu-toggle { margin-left: 0.75rem; }
}

@media (max-width: 767px) {
  .header-cta.btn { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.72rem 1.55rem;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  letter-spacing: -0.012em;
  line-height: 1;
  border: 1px solid transparent;
  transition:
    transform 0.28s var(--ease-premium),
    border-color 0.28s var(--ease-premium),
    background 0.28s var(--ease-premium),
    color 0.28s var(--ease-premium),
    box-shadow 0.28s var(--ease-premium);
  white-space: nowrap;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
}

.btn-primary {
  background: var(--theme-fg);
  color: var(--theme-bg);
  border-color: var(--theme-fg);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--color-primary-hover);
  box-shadow: 0 10px 24px rgba(var(--theme-fg-rgb), 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--theme-fg);
  border-color: rgba(var(--theme-fg-rgb), 0.32);
}

.btn-outline:hover {
  background: rgba(var(--theme-fg-rgb), 0.06);
  border-color: var(--color-text-secondary);
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 36px;
  padding: 0.55rem 1.15rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn .arrow {
  font-style: normal;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.85;
  transition: transform 0.28s var(--ease-premium);
}

.btn:hover .arrow {
  transform: translate(2px, -2px);
  opacity: 1;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--theme-fg-rgb), 0.35);
}

.btn:active {
  transform: translateY(0);
}

/* ---- Service cards ---- */
.service-card {
  position: relative;
  padding: clamp(0.95rem, 1vw, 1.2rem);
  background:
    linear-gradient(145deg, rgba(var(--theme-fg-rgb),0.045), rgba(var(--theme-fg-rgb),0.012) 45%, rgba(var(--theme-fg-rgb),0.028)),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow-elevation-1);
  transition: transform var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base);
}

/* Inner glow on hover */
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--theme-fg-rgb),0.04) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.service-card:hover {
  transform: translateY(-7px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-elevation-hover), var(--glow-white);
}

.service-card:hover::before { opacity: 1; }

.service-icon-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.7rem;
  color: var(--color-text);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.service-card:hover .service-icon-wrap {
  border-color: rgba(var(--theme-fg-rgb),0.2);
  background: rgba(var(--theme-fg-rgb),0.04);
}

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

.service-title {
  font-size: clamp(0.9rem, 0.9vw, 1rem);
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.025em;
}

.service-desc {
  font-size: clamp(0.78rem, 0.8vw, 0.85rem);
  color: var(--color-text-secondary);
  line-height: 1.55;
  flex: 0;
}

.service-arrow {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.service-card:hover .service-arrow {
  transform: translate(3px, -3px);
  color: var(--color-text);
}

/* ---- Work cards ---- */
.work-card {
  display: block;
  color: inherit;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-elevation-1);
  transition: border-color var(--transition-base),
              transform var(--transition-base),
              box-shadow var(--transition-base);
  cursor: pointer;
}

.work-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-elevation-hover);
}

.work-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--color-surface-2);
}

.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: var(--work-image-filter);
  transition: transform 0.7s var(--ease-premium), filter 0.35s var(--ease-premium);
}

.work-image:has(img[src$=".svg"]) {
  background: var(--color-deep-surface);
}

.work-card:hover .work-image img { transform: scale(1.06); }

/* Image overlay on hover */
.work-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-image-overlay);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.work-card:hover .work-image::after { opacity: 1; }

.work-info {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--color-border);
}

.work-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.work-card-kpi {
  display: inline-flex;
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: rgba(var(--theme-fg-rgb),0.7);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.work-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.work-category {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.work-summary {
  margin-top: 0.5rem;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.work-card-link {
  display: inline-flex;
  margin-top: 0.75rem;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.work-card:hover .work-card-link {
  color: var(--theme-fg);
  transform: translateX(3px);
}

/* ---- Filter pills ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  min-height: 38px;
  padding: 0.62rem 1.18rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  letter-spacing: -0.01em;
  background: rgba(var(--theme-fg-rgb),0.015);
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--color-border-hover);
  color: var(--color-text);
  background: rgba(var(--theme-fg-rgb),0.075);
  transform: translateY(-1px);
}

/* ---- Service list (services page) ---- */
.service-list {
  border-top: 1px solid var(--color-border);
  margin-inline: calc(var(--container-padding) * -1);
  padding-inline: var(--container-padding);
}

.service-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: clamp(1rem, 2vw, 1.75rem);
  align-items: center;
  padding: clamp(2rem, 2.75vw, 2.5rem) var(--container-padding);
  margin-inline: calc(var(--container-padding) * -1);
  border-bottom: 1px solid var(--color-border);
  transition:
    background 0.35s var(--ease-premium),
    border-color 0.35s var(--ease-premium);
  position: relative;
  overflow: visible;
}

.service-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--theme-fg-rgb),0.04), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-premium);
  pointer-events: none;
}

.service-row:hover {
  background: rgba(var(--theme-fg-rgb), 0.025);
  border-color: rgba(var(--theme-fg-rgb), 0.1);
}

.service-row:hover::before {
  opacity: 1;
}

.service-row-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: rgba(var(--theme-fg-rgb), 0.72);
  background: rgba(var(--theme-fg-rgb), 0.02);
  transition:
    border-color 0.35s var(--ease-premium),
    color 0.35s var(--ease-premium),
    transform 0.35s var(--ease-premium);
}

.service-row:hover .service-row-icon {
  border-color: rgba(var(--theme-fg-rgb), 0.22);
  color: var(--theme-fg);
  transform: translateY(-2px);
}

.service-row-content h3 {
  font-size: clamp(1.05rem, 1.1vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.service-row-content p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  max-width: 620px;
  line-height: 1.65;
}

.service-row-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-text-secondary);
  transition: color 0.35s var(--ease-premium), gap 0.35s var(--ease-premium);
}

.service-row-link .arrow {
  font-style: normal;
  transition: transform 0.35s var(--ease-premium);
}

.service-row:hover .service-row-link {
  color: var(--theme-fg);
  gap: 0.55rem;
}

.service-row:hover .service-row-link .arrow {
  transform: translate(2px, -2px);
}

@media (max-width: 767px) {
  .service-row {
    grid-template-columns: 44px 1fr;
    gap: 1rem;
    padding-block: clamp(1.5rem, 4vw, 1.75rem);
  }

  .service-row-link {
    grid-column: 2;
    margin-top: 0.35rem;
    justify-self: start;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .service-row {
    grid-template-columns: 44px 1fr;
  }

  .service-row-link {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-3xl) 0 var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand .logo { display: inline-flex; margin-bottom: 0.875rem; }
.footer-brand .logo img { height: 48px; }

.footer-brand p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  max-width: 260px;
}

.footer-col h4 {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.625rem; }

.footer-col a {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer-col a:hover { color: var(--color-text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-bottom:has(.footer-social:only-child) {
  justify-content: space-between;
}

.footer-copy { font-size: var(--font-size-xs); color: var(--color-text-muted); }

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer-legal a:hover { color: var(--color-text); }

.footer-social { display: flex; gap: 0.75rem; }

.footer-social a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.footer-social a:hover { border-color: var(--color-border-hover); color: var(--color-text); }

@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .footer-legal { display: none; }
}
