/* ============================================================
   NEXMACH — B2B Industrial Component Supply
   Design System: Deep-Space Black + Electric Cyan
   Hard lines. No rounded corners. High contrast.
   ============================================================ */

:root {
  --bg: #070b11;
  --bg-2: #0b121b;
  --bg-3: #101a27;
  --panel: #0e1621;
  --line: #1c2a3c;
  --line-2: #2c4056;
  --accent: #00e5ff;
  --accent-dim: #00b8d4;
  --accent-glow: rgba(0, 229, 255, 0.16);
  --text: #f2f6fa;
  --text-2: #b8c6d4;
  --muted: #7d8fa3;
  --warn: #ffb74d;
  --ok: #4ade80;
  --danger: #ff5c7c;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(0,229,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* ============ TOP BAR — single row, 5 symmetric elements, nowrap ============ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7, 11, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 18px;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px;
  border: 2px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.brand small { color: var(--muted); font-weight: 400; letter-spacing: 1px; font-size: 11px; display: block; line-height: 1; }

/* 5 symmetric nav elements — absolutely even, never wrap */
.nav-main {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  flex: 1;
  max-width: 720px;
}
.nav-main a {
  text-align: center;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 4px;
  position: relative;
  transition: color 0.2s;
}
.nav-main a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}
.nav-main a:hover { color: var(--text); text-decoration: none; }
.nav-main a:hover::after { width: 60%; }
.nav-main a.active { color: var(--accent); }
.nav-main a.active::after { width: 60%; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
}

/* ============ HERO ============ */
.hero {
  padding: 150px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -180px; right: -120px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  pointer-events: none;
}
.hero-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.hero-tag::before { content: "//"; color: var(--muted); }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.08;
  letter-spacing: -1px;
  font-weight: 700;
  max-width: 900px;
}
.hero h1 .cy { color: var(--accent); }
.hero p.lead {
  margin-top: 22px;
  max-width: 640px;
  color: var(--text-2);
  font-size: 17px;
}
.hero-cta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); color: #03151a; text-decoration: none; }
.btn-solid { background: var(--accent); color: #03151a; }
.btn-solid:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-ghost { border-color: var(--line-2); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-wa { border-color: var(--ok); color: var(--ok); }
.btn-wa:hover { background: var(--ok); color: #03151a; }

/* ============ SECTION ============ */
.section { padding: 72px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.5px;
}
.section-head .sub { color: var(--muted); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; font-family: var(--mono); }
.section-head .desc { color: var(--text-2); max-width: 520px; font-size: 15px; }

/* ============ STATS STRIP ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-left: none; border-right: none;
  margin: 56px 0 0;
}
.stat { padding: 26px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat b { display: block; font-size: 30px; color: var(--accent); font-weight: 700; letter-spacing: -1px; }
.stat span { color: var(--muted); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }

/* ============ PRODUCT GRID ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.pcard {
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.pcard:hover { border-color: var(--accent); transform: translateY(-3px); }
.pcard .thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}
.pcard .thumb img { max-height: 150px; width: auto; }
.pcard .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard .cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
.pcard h3 { font-size: 17px; line-height: 1.3; }
.pcard .meta { color: var(--muted); font-size: 13px; }
.pcard .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pcard .price { font-family: var(--mono); color: var(--text); font-size: 15px; }
.pcard .price small { color: var(--muted); font-size: 12px; }
.pcard .more { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.badge {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 8px;
  background: var(--accent);
  color: #03151a;
  font-weight: 600;
}
.badge.hot { background: var(--warn); color: #231300; }

/* ============ FILTER BAR ============ */
.filterbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filterbar button {
  background: none;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.2s;
}
.filterbar button:hover { border-color: var(--accent); color: var(--accent); }
.filterbar button.on { background: var(--accent); border-color: var(--accent); color: #03151a; font-weight: 600; }

/* ============ PRODUCT DETAIL ============ */
.pdetail { padding: 140px 0 70px; }
.pd-wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 44px;
  align-items: start;
}
.pd-gallery {
  border: 1px solid var(--line);
  background: var(--bg-3);
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}
.pd-gallery img { max-height: 320px; width: auto; }
.pd-info .cat { font-family: var(--mono); color: var(--accent); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.pd-info h1 { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15; margin: 8px 0 14px; }
.pd-info .price-line { font-family: var(--mono); font-size: 22px; color: var(--accent); margin-bottom: 6px; }
.pd-info .price-line small { color: var(--muted); font-size: 13px; }
.pd-info .desc { color: var(--text-2); margin: 12px 0 20px; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }

/* spec table */
.specs { width: 100%; border-collapse: collapse; margin-top: 18px; }
.specs th, .specs td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
}
.specs th {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 1px;
  background: var(--panel);
  width: 34%;
  text-transform: uppercase;
  font-size: 12px;
}
.specs td { color: var(--text); }

/* trust strip on detail */
.trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 30px;
  border: 1px solid var(--line);
}
.trust div { background: var(--panel); padding: 16px; }
.trust b { display: block; color: var(--accent); font-size: 16px; }
.trust span { color: var(--muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }

/* ============ ABOUT ============ */
.about-hero { padding: 150px 0 60px; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.value-block { border: 1px solid var(--line); background: var(--panel); padding: 26px; }
.value-block h3 { color: var(--accent); font-size: 18px; margin-bottom: 10px; letter-spacing: 0.5px; }
.value-block p { color: var(--text-2); font-size: 14.5px; }
.value-block ul { list-style: none; }
.value-block li { color: var(--text-2); font-size: 14.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.value-block li::before { content: "▸ "; color: var(--accent); }

/* ============ CONTACT / FORMS ============ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}
.form-card { border: 1px solid var(--line); background: var(--panel); padding: 30px; }
.form-card label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted); margin: 16px 0 6px; text-transform: uppercase; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--display);
  font-size: 15px;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-card textarea { min-height: 130px; resize: vertical; }
.form-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.form-ok { color: var(--ok); font-family: var(--mono); font-size: 14px; margin-top: 14px; display: none; }
.form-ok.show { display: block; }

.contact-meta { border: 1px solid var(--line); background: var(--panel); }
.contact-meta .cm-item { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.contact-meta .cm-item:last-child { border-bottom: none; }
.contact-meta b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.contact-meta span { color: var(--text-2); font-size: 14px; word-break: break-all; }

/* ============ BLOG ============ */
.post-card { border: 1px solid var(--line); background: var(--panel); padding: 26px; transition: border-color 0.2s; }
.post-card:hover { border-color: var(--accent); }
.post-card .tag { font-family: var(--mono); color: var(--accent); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.post-card h3 { font-size: 20px; margin: 10px 0 8px; line-height: 1.3; }
.post-card p { color: var(--text-2); font-size: 14.5px; }
.post-card .date { color: var(--muted); font-size: 12px; font-family: var(--mono); margin-top: 14px; display: block; }

/* ============ CTA BAND ============ */
.cta-band {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--bg-3), var(--panel));
  padding: 56px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, var(--accent-glow), transparent 60%);
}
.cta-band h2 { font-size: clamp(24px, 3.4vw, 38px); position: relative; }
.cta-band p { color: var(--text-2); margin: 12px auto 26px; max-width: 560px; position: relative; }
.cta-band .btn { position: relative; }

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--line); padding: 44px 0 30px; margin-top: 70px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 34px;
}
.footer h4 { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--text); margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--text-2); font-size: 14px; }
.footer a:hover { color: var(--accent); }
.footer .about-txt { color: var(--muted); font-size: 13.5px; max-width: 300px; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--mono);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav-main {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    grid-template-columns: 1fr;
    max-width: none;
    display: none;
    padding: 8px 0;
  }
  .nav-main.open { display: grid; }
  .nav-main a { text-align: left; padding: 14px 24px; }
  .nav-main a::after { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .pd-wrap { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .hero { padding: 120px 0 56px; }
  .footer-grid { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .form-card .row2 { grid-template-columns: 1fr; }
}

/* ============ 404 ============ */
.err-wrap { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 120px 20px 60px; }
.err-wrap .code { font-family: var(--mono); font-size: clamp(70px, 14vw, 150px); color: var(--accent); line-height: 1; text-shadow: 0 0 40px var(--accent-glow); }
.err-wrap p { color: var(--text-2); margin: 16px 0 28px; max-width: 420px; }

/* ============ MISC ============ */
.visible { opacity: 1 !important; transform: none !important; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s, transform 0.5s; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
