:root {
  --nex-forest: #0d2f2a;
  --nex-pine: #174c42;
  --nex-mint: #9ed8c6;
  --nex-cream: #f5f1e8;
  --nex-paper: #fffdf8;
  --nex-ink: #17211f;
  --nex-clay: #d57958;
  --nex-line: rgba(13, 47, 42, 0.16);
  --nex-shadow: 0 1px 2px rgba(13, 47, 42, 0.04), 0 28px 80px rgba(13, 47, 42, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 90% 6%, rgba(158, 216, 198, 0.22), transparent 30rem),
    radial-gradient(circle at 6% 96%, rgba(213, 121, 88, 0.07), transparent 34rem),
    var(--nex-cream);
}

a { text-underline-offset: 0.18em; }

.nex-skip-link {
  background: var(--nex-paper);
  color: var(--nex-forest);
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -8rem;
  z-index: 9999;
}

.nex-skip-link:focus { top: 1rem; }

.nex-site-header {
  backdrop-filter: blur(14px);
  background: rgba(245, 241, 232, 0.92);
  border-bottom: 1px solid var(--nex-line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nex-header-inner {
  min-height: 5rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
}

.nex-wordmark a,
.nex-footer-wordmark a {
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.nex-main-nav { font-size: 0.86rem; font-weight: 650; }

.nex-main-nav a { text-decoration: none; }

.nex-nav-cta > a {
  background: var(--nex-clay);
  border-radius: 999px;
  color: var(--nex-paper) !important;
  padding: 0.65rem 1rem !important;
}

.nex-page-shell {
  min-height: 60vh;
  padding-bottom: clamp(5rem, 8vw, 8rem);
}

.nex-page-shell > .wp-block-post-content > .nex-eyebrow:first-child {
  margin-top: clamp(4.5rem, 9vw, 8.5rem);
}

.nex-eyebrow {
  color: var(--nex-pine);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin-bottom: 1.1rem;
  text-transform: uppercase;
}

.nex-page-title {
  color: var(--nex-forest);
  font-size: clamp(2.3rem, 4.6vw, 4.25rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  max-width: 20ch;
}

/* WordPress's own global-styles CSS applies margin-left/right:auto to every
   constrained-layout child via a :where() selector, which ties in specificity
   with a single theme class and can win on source order — beat it explicitly
   instead of relying on cascade order, or the title silently re-centers. */
.wp-block-post-content > .nex-page-title {
  margin-bottom: clamp(1.5rem, 4vw, 3rem) !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  margin-top: 0 !important;
}

.nex-page-shell--home .nex-page-title { max-width: 13ch; }

.wp-block-post-content > p:not(.nex-eyebrow):not(.nex-primary-action) {
  font-size: clamp(1.03rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.wp-block-post-content > p:nth-of-type(2) {
  color: #33433f;
  font-size: clamp(1.2rem, 2vw, 1.48rem) !important;
  line-height: 1.55;
}

.wp-block-post-content h2 {
  border-top: 1px solid var(--nex-line);
  color: var(--nex-forest);
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  letter-spacing: -0.03em;
  margin-top: clamp(4rem, 8vw, 6.5rem);
  padding-top: clamp(2.25rem, 4.5vw, 3.5rem);
}

.wp-block-post-content h3 {
  color: var(--nex-pine);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 750;
  letter-spacing: -0.015em;
  margin-top: 2.5rem;
}

.wp-block-post-content ul,
.wp-block-post-content ol {
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--nex-line);
  border-radius: 1.2rem;
  box-shadow: var(--nex-shadow);
  margin: 2rem 0;
  padding: 1.4rem 1.4rem 1.4rem 3rem;
}

.wp-block-post-content li { margin: 0.55rem 0; }

.nex-primary-action {
  margin: 2rem 0 3.5rem;
}

.nex-primary-action a {
  background: var(--nex-clay);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(213, 121, 88, 0.22);
  color: var(--nex-paper);
  display: inline-block;
  font-weight: 750;
  padding: 0.9rem 1.25rem;
  text-decoration: none;
}

.nex-draft-banner {
  background: var(--nex-forest);
  border-radius: 1.2rem;
  color: var(--nex-paper);
  font-size: 0.87rem;
  margin: 2rem auto 0;
  max-width: 1240px;
  padding: 0.75rem 1rem;
  text-align: center;
}

.nex-site-footer {
  background: var(--nex-forest);
  color: rgba(255, 253, 248, 0.76);
  padding-bottom: 2rem;
  padding-top: clamp(4rem, 8vw, 7rem);
}

.nex-site-footer a { color: var(--nex-paper); }
.nex-site-footer h3 { color: var(--nex-mint); font-family: inherit; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nex-site-footer ul { list-style: none; margin: 0; padding: 0; }
.nex-site-footer li { margin: 0.55rem 0; }
.nex-footer-note { color: var(--nex-mint); font-size: 0.84rem; }
.nex-footer-bottom { border-top: 1px solid rgba(255, 253, 248, 0.18); font-size: 0.78rem; margin-top: 3rem; padding-top: 1.4rem; }

:focus-visible { outline: 3px solid var(--nex-clay); outline-offset: 4px; }

@media (max-width: 920px) {
  .nex-header-inner { align-items: center; }
  .nex-main-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 2rem; }
  .nex-main-nav .wp-block-navigation__responsive-container.is-menu-open a { color: var(--nex-paper); }
}

@media (max-width: 700px) {
  .nex-page-title { font-size: clamp(2.45rem, 12vw, 4rem); }
  .nex-footer-grid { gap: 2.5rem; }
}

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

.nex-inquiry-panel {
  margin: clamp(2.75rem, 5vw, 5rem) 0;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border: 1px solid var(--nex-line);
  border-radius: 1.2rem;
  background: var(--nex-paper);
}

.nex-inquiry-panel h2 { margin-top: 0; }

.nex-form-notice {
  padding: 0.85rem 1.15rem;
  border-radius: 0.6rem;
  margin: 1.25rem 0;
  font-weight: 600;
}

.nex-form-notice--success { background: rgba(158, 216, 198, 0.35); color: var(--nex-forest); }
.nex-form-notice--error { background: rgba(213, 121, 88, 0.16); color: var(--nex-clay); }

.nex-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0;
}

.nex-form-field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.92rem; }
.nex-form-field--wide { margin: 1.5rem 0; }

.nex-form-field input,
.nex-form-field select,
.nex-form-field textarea {
  font: inherit;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--nex-line);
  border-radius: 0.5rem;
  background: var(--nex-cream);
  color: var(--nex-ink);
}

.nex-form-field input:focus,
.nex-form-field select:focus,
.nex-form-field textarea:focus { outline: 2px solid var(--nex-clay); outline-offset: 1px; }

.nex-form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nex-form-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.86rem;
  margin: 1.25rem 0;
}

.nex-inquiry-form button[type="submit"] {
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.6rem;
  border: none;
  border-radius: 999px;
  background: var(--nex-clay);
  color: var(--nex-paper);
  cursor: pointer;
}

.nex-form-footnote { color: var(--nex-pine); font-size: 0.82rem; margin-top: 1rem; }

/* Card grid: converts long list-shaped sections (OEM/ODM, formats, process
   support, comparison tables) into scannable tiles instead of prose. */
.nex-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.nex-card-grid--pair {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.nex-card {
  background: var(--nex-paper);
  border: 1px solid var(--nex-line);
  border-radius: 1.2rem;
  box-shadow: var(--nex-shadow);
  padding: 1.6rem 1.5rem;
}

.nex-card-title {
  color: var(--nex-forest);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

.nex-card p { margin: 0.6rem 0; font-size: 0.98rem; }

.nex-card-field { margin: 0.9rem 0; }
.nex-card-field:first-of-type { margin-top: 0.4rem; }

.nex-card-label {
  color: var(--nex-pine);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nex-card .nex-text-link,
.nex-card .nex-text-link-group { margin: 1.1rem 0 0; }

/* Step sequence: numbered process/factor lists rendered as connected tiles
   instead of a run of ####/paragraph blocks. */
.nex-step-list {
  counter-reset: none;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

.nex-step {
  background: var(--nex-paper);
  border: 1px solid var(--nex-line);
  border-radius: 1.2rem;
  display: flex;
  gap: 1rem;
  padding: 1.4rem 1.3rem;
}

.nex-step-number {
  align-items: center;
  background: var(--nex-forest);
  border-radius: 999px;
  color: var(--nex-paper);
  display: flex;
  flex-shrink: 0;
  font-weight: 750;
  height: 2.1rem;
  justify-content: center;
  width: 2.1rem;
}

.nex-step-body h4 {
  color: var(--nex-forest);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 1.02rem;
  font-weight: 750;
  margin: 0.2rem 0 0.5rem;
}

.nex-step-body p { font-size: 0.95rem; margin: 0; }

/* Secondary/inline links: replaces the raw "Text link:" / "Supporting text
   link:" scaffold labels with one consistent arrow-link treatment. */
.nex-text-link a,
.nex-text-link-group a {
  color: var(--nex-pine);
  font-weight: 700;
  text-decoration: none;
}

.nex-text-link a:hover,
.nex-text-link-group a:hover { text-decoration: underline; }

.nex-text-link a span,
.nex-text-link-group a span { color: var(--nex-clay); }

.nex-text-link-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

/* Real photography: factory floor and product shots dropped into copy via
   markdown image syntax. Framed consistently so a phone-shot factory photo
   and a studio product render sit at the same visual weight. */
.nex-photo {
  margin: 2rem 0;
}

.nex-photo img {
  border-radius: 1.2rem;
  box-shadow: var(--nex-shadow);
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.nex-photo figcaption {
  color: var(--nex-pine);
  font-size: 0.82rem;
  margin-top: 0.6rem;
}

.nex-photo-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  margin: 2rem 0;
}

.nex-photo-grid .nex-photo { margin: 0; }

/* Stats: real, sourced numbers only — never a placeholder value. */
.nex-stat-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  margin: 2rem 0;
}

.nex-stat {
  background: var(--nex-paper);
  border: 1px solid var(--nex-line);
  border-radius: 1.2rem;
  padding: 1.4rem 1.3rem;
  text-align: center;
}

.nex-stat-number {
  color: var(--nex-forest);
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nex-stat-label {
  color: var(--nex-pine);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 0.3rem;
}

/* Hero carousel: real facility video + photos, simple crossfade, no library. */
.nex-hero-carousel {
  border-radius: 1.2rem;
  box-shadow: var(--nex-shadow);
  margin: 2rem 0 1rem;
  overflow: hidden;
  position: relative;
}

.nex-hero-track {
  aspect-ratio: 16 / 9;
  position: relative;
}

.nex-hero-slide {
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 0.9s ease;
}

.nex-hero-slide.is-active { opacity: 1; }

.nex-hero-media {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.nex-hero-slide figcaption {
  background: linear-gradient(to top, rgba(13, 47, 42, 0.72), transparent 65%);
  bottom: 0;
  color: var(--nex-paper);
  font-size: 0.9rem;
  font-weight: 650;
  left: 0;
  padding: 2.5rem 1.5rem 1rem;
  position: absolute;
  right: 0;
}

.nex-hero-dots {
  bottom: 0.9rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  position: absolute;
  width: 100%;
  z-index: 2;
}

.nex-hero-dot {
  background: rgba(255, 253, 248, 0.5);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  height: 0.5rem;
  padding: 0;
  transition: background 0.3s ease, width 0.3s ease;
  width: 0.5rem;
}

.nex-hero-dot.is-active {
  background: var(--nex-paper);
  width: 1.4rem;
}

@media (prefers-reduced-motion: reduce) {
  .nex-hero-slide { transition: none; }
}

.nex-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 1.5rem 0;
}

.nex-social-links > a {
  margin-top: 0 !important;
}

.nex-social-link {
  color: var(--nex-paper);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(255, 253, 248, 0.35);
  text-underline-offset: 0.2em;
}

.nex-social-link:hover {
  color: var(--nex-clay);
  text-decoration-color: var(--nex-clay);
}

/* Quiet scroll-in: below-the-fold content only, never the hero. One-time
   reveal via IntersectionObserver in motion.js, not re-triggered. */
.reveal-on-scroll {
  transition: opacity 550ms ease-out, transform 550ms ease-out;
}

.reveal-on-scroll:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

.nex-card,
.nex-step,
.nex-photo {
  transition: box-shadow 220ms ease, transform 220ms ease, opacity 550ms ease-out;
}

.nex-card:hover,
.nex-card:focus-within,
.nex-step:hover,
.nex-step:focus-within {
  box-shadow: 0 28px 60px rgba(13, 47, 42, 0.16);
  transform: translateY(-3px);
}

.nex-photo {
  overflow: hidden;
}

.nex-photo img {
  transition: transform 380ms ease;
}

.nex-photo:hover img,
.nex-photo:focus-within img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .nex-card:hover,
  .nex-card:focus-within,
  .nex-step:hover,
  .nex-step:focus-within {
    transform: none;
  }

  .nex-photo:hover img,
  .nex-photo:focus-within img {
    transform: none;
  }
}
