/* ==========================================================================
   Texvian IT — HOME 01: IT SOLUTIONS (page-specific)
   Built entirely from Phase 1 tokens/components (variables, typography,
   buttons, cards, badges, .nx-section, .nx-reveal, .nx-marquee). No new
   colors, spacing, or type sizes are introduced here — only page-specific
   composition classes that couldn't reasonably live in the global
   component library.
   ========================================================================== */

/* ==========================================================================
   1. HERO
   ========================================================================== */

.nx-hero {
  position: relative;
  padding-block-start: clamp(2rem, 1.6rem + 1.5vw, 3.5rem);
  padding-block-end: var(--nx-section-space-y-sm);
  overflow: hidden;
}

.nx-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(560px 420px at 82% 8%, color-mix(in srgb, var(--nx-primary) 14%, transparent), transparent 70%),
    radial-gradient(480px 380px at 6% 85%, color-mix(in srgb, var(--nx-secondary) 12%, transparent), transparent 70%),
    linear-gradient(90deg, var(--nx-border-color) 1px, transparent 1px),
    linear-gradient(var(--nx-border-color) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
  background-position: 0 0, 0 0, center, center;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 0%, transparent 75%);
  opacity: 0.7;
}

.nx-hero__row {
  position: relative;
  z-index: 1;
}

.nx-hero__title {
  font-size: var(--nx-fs-h1);
  margin-block: var(--nx-space-5);
  max-width: 18ch;
  letter-spacing: -1px;
}

.nx-hero__lead {
  max-width: 46ch;
  margin-bottom: var(--nx-space-6);
}

.nx-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nx-space-3);
  margin-bottom: var(--nx-space-6);
}

.nx-hero__trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-3);
}

.nx-hero__trust-badges .badge-status {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-xs);
  letter-spacing: var(--nx-ls-wide);
  padding: var(--nx-space-2);
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
}

.nx-hero__trust-badges .badge-status::before {
  display: none;
}

/* ---------------- Hero visual: device / console mockup ---------------- */
.nx-hero__visual {
  position: relative;
  padding: var(--nx-space-6);
}

.nx-hero__device {
  position: relative;
  z-index: 1;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-lg);
  overflow: hidden;
}

.nx-hero__device-bar {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-3) var(--nx-space-4);
  background: var(--nx-surface-alt);
  border-bottom: 1px solid var(--nx-border-color);
}

.nx-hero__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--nx-border-color-strong);
}

.nx-hero__device-label {
  margin-left: var(--nx-space-2);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-xs);
  letter-spacing: var(--nx-ls-wide);
  color: var(--nx-text-muted);
}

.nx-hero__device-body {
  padding: var(--nx-space-6);
}

.nx-hero__metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--nx-fs-sm);
  color: var(--nx-text-secondary);
  margin-bottom: var(--nx-space-3);
}

.nx-hero__metric-head span:last-child {
  font-family: var(--nx-font-display);
  font-size: var(--nx-fs-lg);
  font-weight: var(--nx-fw-semibold);
  color: var(--nx-primary);
}

.nx-hero__sparkline {
  width: 100%;
  height: 56px;
  display: block;
  margin-bottom: var(--nx-space-6);
}

.nx-hero__sparkline path {
  fill: none;
  stroke: var(--nx-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nx-hero__sparkline .nx-hero__sparkline-fill {
  stroke: none;
  fill: url(#nxSparklineGradient);
  opacity: 0.5;
}

.nx-hero__metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--nx-space-3);
}

.nx-hero__metric-tile {
  padding: var(--nx-space-4);
  background: var(--nx-surface-alt);
  border-radius: var(--nx-radius-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nx-hero__metric-num {
  font-family: var(--nx-font-display);
  font-size: var(--nx-fs-h5);
  font-weight: var(--nx-fw-semibold);
  color: var(--nx-text-primary);
}

.nx-hero__metric-tile span:last-child {
  font-size: var(--nx-fs-xs);
  color: var(--nx-text-muted);
}

/* Floating chips */
.nx-hero__chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-2) var(--nx-space-4);
  background: var(--nx-surface);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-pill);
  box-shadow: var(--nx-shadow-md);
  font-size: var(--nx-fs-xs);
  font-weight: var(--nx-fw-medium);
  color: var(--nx-text-primary);
  white-space: nowrap;
}

.nx-hero__chip .bi {
  color: var(--nx-secondary);
}

.nx-hero__chip--1 {
  top: 4%;
  right: -2%;
  animation-delay: 0ms;
}

.nx-hero__chip--2 {
  bottom: 0%;
  left: 0%;
  animation-delay: 600ms;
}

.nx-hero__chip--3 {
  bottom: 0%;
  right: 0%;
  animation-delay: 1100ms;
}

@media (max-width: 1199.98px) {
  .nx-hero__chip--1 {
    right: 2%;
  }

  .nx-hero__chip--2 {
    left: 0;
  }
}

@media (max-width: 767.98px) {
  .nx-hero__chip {
    display: none;
  }
}

/* ---------------- Hero stats strip ---------------- */
.nx-hero-stats {
  position: relative;
  z-index: 1;
  margin-top: clamp(1.75rem, 1.4rem + 1.5vw, 3rem);
  padding-top: var(--nx-space-6);
  border-top: 1px solid var(--nx-divider);
  display: flex;
  flex-wrap: wrap;
}

.nx-hero-stat {
  flex: 1 1 0;
  min-width: 140px;
  padding-inline: var(--nx-space-5);
  border-left: 1px solid var(--nx-divider);
}

.nx-hero-stat:first-child {
  border-left: none;
  padding-left: 0;
}

.nx-hero-stat__value {
  display: block;
  font-family: var(--nx-font-display);
  font-size: var(--nx-fs-h3);
  font-weight: var(--nx-fw-bold);
  color: var(--nx-text-primary);
  line-height: 1;
  margin-bottom: var(--nx-space-2);
}

.nx-hero-stat__label {
  font-size: var(--nx-fs-sm);
  color: var(--nx-text-secondary);
}

@media (max-width: 575.98px) {
  .nx-hero-stat {
    flex: 1 1 50%;
    border-left: none;
    padding-inline: 0;
    margin-bottom: var(--nx-space-5);
  }
}

/* ==========================================================================
   3. ABOUT COMPANY
   ========================================================================== */

/* Shared "media composition" pattern: an image frame with an overlapping
   floating stat card. Used by About Company and (Phase 2B) Why Choose Us
   so the treatment isn't duplicated per section — only the content and
   the corner the stat card overlaps (--right modifier) differ. */
.nx-media-composition {
  position: relative;
}

.nx-media-frame {
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  border: 1px solid var(--nx-border-color);
  box-shadow: var(--nx-shadow-lg);
  aspect-ratio: 5 / 6;
}

.nx-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nx-media-stat-card {
  position: absolute;
  left: -8%;
  bottom: 8%;
  z-index: 2;
  width: min(230px, 60%);
  background: var(--nx-surface);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-lg);
  padding: var(--nx-space-5);
}

.nx-media-stat-card--right {
  left: auto;
  right: -8%;
}

.nx-media-stat-card .nx-stat-card__value {
  font-size: var(--nx-fs-h3);
  color: var(--nx-primary);
}

@media (max-width: 767.98px) {
  .nx-media-stat-card {
    position: static;
    width: 100%;
    margin-top: var(--nx-space-5);
  }
}

.nx-about__badge-eyebrow {
  margin-bottom: var(--nx-space-4);
}

.nx-about__heading {
  max-width: 20ch;
}

.nx-about__lead {
  max-width: 52ch;
  margin-bottom: var(--nx-space-6);
}

/* Shared inline-stat pattern (value + label pairs in a row), used by
   About Company and Why Choose Us. */
.nx-inline-stat-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-6);
  margin-bottom: var(--nx-space-7);
  padding-bottom: var(--nx-space-7);
  border-bottom: 1px solid var(--nx-divider);
}

.nx-inline-stat {
  min-width: 120px;
}

.nx-inline-stat__value {
  display: block;
  font-family: var(--nx-font-display);
  font-size: var(--nx-fs-h3);
  font-weight: var(--nx-fw-bold);
  color: var(--nx-text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.nx-inline-stat__label {
  font-size: var(--nx-fs-xs);
  color: var(--nx-text-secondary);
}

.nx-about__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--nx-space-4);
  margin-bottom: var(--nx-space-7);
}

.nx-about__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-space-3);
}

.nx-about__feature-icon {
  --size: 32px;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-sm);
  background: var(--nx-secondary-soft);
  color: var(--nx-secondary-hover);
  font-size: 0.95rem;
}

.nx-about__feature-text {
  font-size: var(--nx-fs-sm);
  font-weight: var(--nx-fw-medium);
  color: var(--nx-text-primary);
}

@media (max-width: 575.98px) {
  .nx-about__features {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   4. SERVICES
   ========================================================================== */

.nx-services__grid>* {
  display: flex;
}

.nx-service-card {
  width: 100%;
}

/* Uses fixed ink-palette tokens (not the theme-relative --nx-surface-
   inverse / --nx-text-inverse tokens) so this stays a deliberately dark
   accent card in BOTH themes — the same pattern the footer uses for its
   always-dark surface. --nx-surface-inverse is correct for elements that
   should flip opposite the page (e.g. a tooltip); this card should not
   flip, since "white card with white icon" in dark mode was exactly the
   bug that motivated this comment. */
.nx-service-card--featured {
  background: var(--nx-ink-900);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--nx-white);
  position: relative;
  overflow: hidden;
}

[data-bs-theme="dark"] .nx-service-card--featured {
  background: var(--nx-ink-950);
  border-color: rgba(255, 255, 255, 0.1);
}

.nx-service-card--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 60% at 100% 0%, #000 0%, transparent 70%);
  pointer-events: none;
}

.nx-service-card--featured .nx-card__title,
.nx-service-card--featured h3 {
  color: var(--nx-white);
  font-size: var(--nx-fs-h4);
}

.nx-service-card--featured .nx-card__text {
  color: var(--nx-slate-300);
}

.nx-service-card--featured .nx-card__icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--nx-white);
}

.nx-service-card--featured:hover .nx-card__icon {
  background: var(--nx-primary);
}

.nx-service-card--featured .nx-card__link {
  color: var(--nx-slate-200);
}

.nx-service-card--featured:hover .nx-card__link {
  color: var(--nx-circuit-400);
}

/* ==========================================================================
   PHASE 2B
   ========================================================================== */

/* ==========================================================================
   7. INDUSTRIES
   ========================================================================== */

.nx-industry-card {
  width: 100%;
}

.nx-industry-card .nx-card__icon {
  --size: 48px;
  font-size: 1.3rem;
  margin-bottom: var(--nx-space-4);
}

.nx-industry-card .nx-card__title {
  font-size: var(--nx-fs-lg);
}

/* ==========================================================================
   9. CASE STUDIES
   ========================================================================== */

.nx-case-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--nx-space-2);
  margin-bottom: var(--nx-space-8);
}

.nx-case-filters .nx-tag {
  padding: var(--nx-space-2) var(--nx-space-4);
  font-size: var(--nx-fs-sm);
  border: 1px solid var(--nx-border-color);
  cursor: pointer;
}

/* Scoped to :not(.is-active) so this never fights the base .nx-tag.is-active
   rule in components/badges.css (same selector specificity, and this file
   loads later — without the guard, the active filter's white text would
   render on top of this white background instead of the intended primary
   fill, since only background/border were being redeclared here). */
.nx-case-filters .nx-tag:not(.is-active) {
  background: var(--nx-surface);
}

.nx-case-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: var(--nx-transition-base), transform var(--nx-duration-base) var(--nx-ease-emphasized);
}

.nx-case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--nx-shadow-md);
  border-color: var(--nx-border-color-strong);
}

/* The filter module (case-studies-filter.js) toggles `.is-hidden` on the
   grid-column wrapper (`[data-nx-case-item]`), not on `.nx-case-card`
   itself — this selector must match that wrapper or nothing is hidden. */
[data-nx-case-item].is-hidden {
  display: none;
}

.nx-case-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.nx-case-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--nx-duration-slower) var(--nx-ease-emphasized);
}

.nx-case-card:hover .nx-case-card__media img {
  transform: scale(1.06);
}

.nx-case-card__category {
  position: absolute;
  top: var(--nx-space-3);
  left: var(--nx-space-3);
}

.nx-case-card__body {
  padding: var(--nx-space-5);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.nx-case-card__title {
  font-size: var(--nx-fs-lg);
  margin-bottom: var(--nx-space-2);
}

.nx-case-card__text {
  font-size: var(--nx-fs-sm);
  color: var(--nx-text-secondary);
  margin-bottom: var(--nx-space-4);
}

.nx-case-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-2);
  margin-bottom: var(--nx-space-4);
}

.nx-case-card__tags .nx-tag {
  font-size: 0.7rem;
  padding: 4px var(--nx-space-3);
}

.nx-case-card__metrics {
  display: flex;
  gap: var(--nx-space-5);
  margin-bottom: var(--nx-space-4);
  padding-top: var(--nx-space-4);
  border-top: 1px solid var(--nx-divider);
}

.nx-case-card__metric-value {
  display: block;
  font-family: var(--nx-font-display);
  font-weight: var(--nx-fw-bold);
  font-size: var(--nx-fs-lg);
  color: var(--nx-primary);
  line-height: 1;
  margin-bottom: 2px;
}

.nx-case-card__metric-label {
  font-size: var(--nx-fs-xs);
  color: var(--nx-text-muted);
}

.nx-case-card__link {
  margin-top: auto;
}

.nx-case-empty {
  display: none;
  text-align: center;
  padding-block: var(--nx-space-9);
  color: var(--nx-text-secondary);
}

.nx-case-empty.is-visible {
  display: block;
}