/* ==========================================================================
   NaiX  shared stylesheet
   Design language: a technical drawing / drafting-sheet vocabulary 
   NaiX's whole pitch is making architecture legible, so the site borrows
   the conventions of an actual blueprint: cyanotype panels, registration
   marks, hairline spec-sheet grids, one pencil-red accent for emphasis.
   ========================================================================== */

:root {
  /* Paper + ink */
  --paper: #f2f2ec;
  --panel: #ffffff;
  --ink: #16213e;
  --ink-soft: #4d5566;
  --ink-faint: #8791a3;
  --line: #d9d9d0;

  /* Blueprint (diagram panels + footer) */
  --blueprint: #16345e;
  --blueprint-deep: #0f2540;
  --blueprint-panel: #1c3f6e;
  --blueprint-line: #a9d2e6;
  --blueprint-line-dim: rgba(169, 210, 230, 0.35);
  --blueprint-text: #eef5f9;
  --blueprint-text-dim: #86a9c2;

  /* Signal  the one deliberate accent, used sparingly for emphasis */
  --signal: #c1440e;
  --signal-dim: #dd8a63;

  --radius-sm: 3px;
  --radius: 5px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink-soft);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.3rem, 4.4vw, 3.7rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* A quiet reference tag  used only where content is genuinely sequential
   (numbered services, process steps). Not a decorative label. */
.tag {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--blueprint); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-gradient {
  background: var(--signal);
  color: #fff;
}
.btn-gradient:hover { background: #a33a0c; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 242, 236, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { height: 42px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--signal);
}
.nav-right { display: flex; align-items: center; gap: 18px; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span { width: 22px; height: 2px; background: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 70px 0 60px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 50px;
  align-items: center;
}
.hero h1 { margin-bottom: 20px; }
.hero-lead { font-size: 1.13rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-family: "Space Grotesk", sans-serif; font-size: 1.4rem; color: var(--ink); }
.hero-stat span { font-size: 0.85rem; color: var(--ink-faint); }

.hero-caps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px 20px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--blueprint-line-dim);
}
.hero-cap {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 0.83rem;
  color: var(--blueprint-text-dim);
  font-weight: 400;
}
.hero-cap .dot {
  width: 5px; height: 5px;
  background: var(--blueprint-line);
  flex-shrink: 0;
  transform: translateY(-2px);
}

/* The hero diagram's connective line draws itself in on load, like tracing
   a blueprint; once drawn, a pulse keeps travelling it and the NaiX-scope
   bracket keeps marching  reading as live, ongoing architecture work
   rather than a static picture. This is the page's one motion set piece;
   everything else on the page stays calm. */
.hero-draw {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-in 1.6s ease-out 0.2s forwards;
}
@keyframes draw-in { to { stroke-dashoffset: 0; } }

.hero-pulse {
  opacity: 0;
  filter: drop-shadow(0 0 5px rgba(193, 68, 14, 0.9));
  animation: hero-pulse-travel 3.2s cubic-bezier(.4,0,.6,1) 1.9s infinite;
}
@keyframes hero-pulse-travel {
  0%   { transform: translateX(0); opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { transform: translateX(480px); opacity: 0; }
}

.hero-bracket {
  animation: hero-march 1s linear 1.9s infinite;
}
@keyframes hero-march { to { stroke-dashoffset: -24; } }

@media (prefers-reduced-motion: reduce) {
  .hero-draw { animation: none; stroke-dashoffset: 0; }
  .hero-pulse { animation: none; opacity: 0; }
  .hero-bracket { animation: none; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.page-hero p { max-width: 62ch; font-size: 1.05rem; margin-top: 14px; }

/* ---------- Photography  duotone-tinted to sit inside the blueprint
   system instead of reading as generic stock imagery, captioned like a
   figure plate in a technical document rather than a decorative hero. */
.photo-banner { padding: 48px 0 0; }
.photo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: var(--blueprint);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.08);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, var(--blueprint) 0%, var(--signal) 130%);
  mix-blend-mode: color;
  z-index: 1;
}
.photo-caption {
  position: absolute;
  left: 20px; bottom: 16px;
  z-index: 2;
  background: rgba(15, 37, 64, 0.88);
  color: var(--blueprint-text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  padding: 6px 12px;
}
@media (max-width: 720px) {
  .photo-frame { aspect-ratio: 4 / 5; }
}

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-header {
  max-width: 640px;
  margin-bottom: 46px;
}
.section-header.center { max-width: 640px; }
.section-subtitle { font-size: 1.03rem; margin: 0; }

/* ---------- Spec grid (cards / pillars / steps share one device:
   a joined hairline grid, like a parts list on a drawing sheet 
   not floating shadowed cards) ---------- */
.cards-grid,
.pillars,
.steps {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cards-grid { grid-template-columns: repeat(3, 1fr); }
.pillars { grid-template-columns: repeat(4, 1fr); }
.steps { grid-template-columns: repeat(3, 1fr); }

.card, .pillar, .step, .product-card {
  position: relative;
  display: block;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 30px 26px;
  background: transparent;
  transition: background 0.15s ease;
}
a.card { cursor: pointer; }
.card::before, .pillar::before, .step::before, .product-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--signal);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.2s ease;
}
.card:hover, .pillar:hover, .step:hover, .product-card:hover { background: var(--panel); }
.card:hover::before, .pillar:hover::before, .step:hover::before, .product-card:hover::before { transform: scaleY(1); }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.card-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.card-icon svg { width: 24px; height: 24px; }
.card h3, .pillar h3, .step h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p, .pillar p, .step p { margin-bottom: 0; font-size: 0.95rem; }
.card-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 1px;
}
.card:hover .card-link { border-color: var(--signal); color: var(--signal); }

.pillar-num, .step-index { display: none; } /* superseded by .tag inside content */

/* ---------- Diagrams  styled as an actual technical drawing:
   cyanotype panel, hairline linework, drafting corner marks ---------- */
.diagram-card {
  position: relative;
  background: var(--blueprint);
  padding: 40px;
  border-radius: var(--radius-sm);
  background-image:
    linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)), linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)),
    linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)), linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)),
    linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)), linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)),
    linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim)), linear-gradient(var(--blueprint-line-dim), var(--blueprint-line-dim));
  background-repeat: no-repeat;
  background-size: 18px 1px, 1px 18px, 18px 1px, 1px 18px, 18px 1px, 1px 18px, 18px 1px, 1px 18px;
  background-position:
    14px 14px, 14px 14px,
    calc(100% - 14px) 14px, calc(100% - 14px) 14px,
    14px calc(100% - 14px), 14px calc(100% - 14px),
    calc(100% - 14px) calc(100% - 14px), calc(100% - 14px) calc(100% - 14px);
}
.diagram-scroll { overflow-x: auto; }
.diagram-scroll svg { display: block; margin: 0 auto; min-width: 620px; }
.diagram-caption {
  text-align: left;
  color: var(--blueprint-text-dim);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  margin-top: 18px;
  margin-bottom: 0;
}
.diagram-card.light { background: var(--blueprint); }
.diagram-card.light .diagram-caption { color: var(--blueprint-text-dim); }

/* ---------- Split section (image/content) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split.reverse .split-visual { order: -1; }

/* ---------- CTA banner ---------- */
.cta-banner {
  padding: 52px 56px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.cta-banner h2 { color: #fff; margin-bottom: 8px; }
.cta-banner p { color: #a8b0c4; margin-bottom: 0; max-width: 46ch; }
.cta-banner .btn-primary { background: #fff; color: var(--ink); }
.cta-banner .btn-primary:hover { background: var(--blueprint-line); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blueprint-deep);
  color: var(--blueprint-text-dim);
  padding: 60px 0 26px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(169, 210, 230, 0.18);
}
.footer-brand .logo img { height: 28px; }
.footer-brand p { color: var(--blueprint-text-dim); font-size: 0.92rem; margin: 14px 0 0; max-width: 30ch; }
.footer-col h4 { color: var(--blueprint-text); font-family: "Space Grotesk", sans-serif; font-size: 0.9rem; margin-bottom: 16px; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.92rem; color: var(--blueprint-text-dim); }
.footer-col a:hover { color: var(--blueprint-text); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: #5c7590;
  flex-wrap: wrap;
  gap: 12px;
}
.social-row { display: flex; gap: 12px; }
.social-row a {
  width: 32px; height: 32px;
  border: 1px solid rgba(169, 210, 230, 0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--blueprint-text-dim);
}
.social-row a:hover { color: var(--blueprint-text); border-color: var(--blueprint-text-dim); }
.social-row svg { width: 15px; height: 15px; }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  align-items: flex-start;
}
.contact-info-item {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.contact-info-item:first-child { padding-top: 0; }
.contact-info-item .card-icon { margin-bottom: 0; flex-shrink: 0; }
.contact-info-item h4 { margin: 0 0 4px; color: var(--ink); font-size: 0.98rem; font-family: "Space Grotesk", sans-serif; }
.contact-info-item p { margin: 0; font-size: 0.92rem; }

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.82rem; color: var(--ink-faint); margin-top: 10px; }
.form-success {
  display: none;
  padding: 16px 18px;
  background: #eef6ee;
  color: #2f5a34;
  border: 1px solid #bcdcc0;
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.form-error {
  display: none;
  padding: 16px 18px;
  background: #fbeae6;
  color: #8a3418;
  border: 1px solid #f0c3b2;
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.field-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Products (coming soon) ---------- */
.product-card { border-style: dashed; }
.product-badge {
  position: absolute;
  top: 26px; right: 26px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--signal);
}
.product-mark {
  width: 40px; height: 40px;
  border: 1.5px solid var(--ink);
  margin-bottom: 20px;
}

/* ---------- Scroll interaction ----------
   The bold, singular move is diagrams tracing themselves in as you reach
   them (below). Card/section entrances stay a quiet supporting layer:
   small movement, quick timing, tight stagger  a row settles in as one
   block rather than cascading item by item. */
.reveal,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.reveal { transform: translateY(10px); }
.reveal-left { transform: translateX(-14px); }
.reveal-right { transform: translateX(14px); }
.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: none;
}
.cards-grid > .reveal:nth-child(3n+2) { transition-delay: 0.05s; }
.cards-grid > .reveal:nth-child(3n)   { transition-delay: 0.1s; }
.pillars > .reveal:nth-child(4n+2) { transition-delay: 0.05s; }
.pillars > .reveal:nth-child(4n+3) { transition-delay: 0.1s; }
.pillars > .reveal:nth-child(4n)   { transition-delay: 0.15s; }
.steps > .reveal:nth-child(3n+2) { transition-delay: 0.05s; }
.steps > .reveal:nth-child(3n)   { transition-delay: 0.1s; }

/* Diagram linework traces in as each diagram is scrolled to  the hero
   does this on load (see .hero-draw); every other diagram does it on
   scroll. One consistent device, not a different effect per element. */
.draw-in {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 1.3s ease-out;
}
.draw-in.is-visible { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .draw-in {
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
}

/* Drafting-ruler scroll progress  a tick-marked rail that fills with
   ink as you move through the page. The one continuous scroll cue,
   in place of a generic top loading bar. Hidden on narrow screens,
   where it would compete with the content edge. */
.scroll-ruler {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(to bottom, var(--line) 0px, var(--line) 1px, transparent 1px, transparent 14px);
  z-index: 90;
  pointer-events: none;
}
.scroll-ruler-fill {
  position: absolute;
  left: 0; top: 0; width: 100%;
  height: 0%;
  background: var(--signal);
}
.scroll-ruler::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(242, 242, 236, 0.55) 0px, rgba(242, 242, 236, 0.55) 1px, transparent 1px, transparent 14px);
}
@media (max-width: 900px) { .scroll-ruler { display: none; } }
@media (prefers-reduced-motion: reduce) { .scroll-ruler-fill { transition: none; } }

/* Header firms up once the page has actually moved */
.site-header.is-scrolled { border-bottom-color: var(--ink); }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: left; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-visual { order: 0; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero-caps { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-wrap.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--paper);
    padding: 20px 24px 26px;
    border-bottom: 1px solid var(--line);
  }
  .cards-grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .cta-banner { padding: 34px 26px; }
  .section { padding: 54px 0; }
  .hero { padding: 46px 0 40px; }
}
