/* ==========================================================================
   Dịch Vụ Nam Trung — Design system
   Hướng thiết kế: "sơ đồ kỹ thuật" (schematic) — đường nét đứt, nhãn mono,
   đèn trạng thái amber/green — gắn trực tiếp với ngành máy tính/mạng/camera
   thay vì giao diện công ty công nghệ chung chung.
   ========================================================================== */

:root {
  /* Màu */
  --paper: #f4f6f8;
  --paper-raised: #ffffff;
  --paper-band: #edf1f6;
  --ink: #101820;
  --text: #1b2530;
  --muted: #5c6b7a;
  --border: #dce3ea;
  --circuit: #2c5aa0;
  --circuit-bright: #3e76c9;
  --amber: #e2932e;
  --amber-dark: #c97f1f;
  --green: #2e9b5d;

  /* Chữ */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-family: var(--font-display); color: var(--ink); }

a { color: var(--circuit); }

img, svg { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--circuit);
  margin: 0 0 12px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
  color: var(--ink);
}

.section-lede {
  text-align: center;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}
.btn-primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--circuit);
  color: var(--circuit);
}
.btn-outline:hover { background: var(--circuit); color: #fff; }

/* Status dot (đèn trạng thái) */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------------------------- Header ---------------------------- */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.logo-mark { color: var(--circuit); flex-shrink: 0; }
.logo-mark svg { width: 26px; height: 26px; display: block; }
.logo-accent { color: var(--circuit); }

.main-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--circuit); border-color: var(--circuit); }

.call-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}
.call-chip:hover { border-color: var(--amber); }

@media (max-width: 760px) {
  .main-nav { display: none; }
  .call-chip { display: none; }
}

/* ---------------------------- Hero ---------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 64px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  z-index: 0;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.hero .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 18px;
}
.hero h1 .accent { color: var(--circuit); }
.hero-inner { max-width: 800px; margin: 0 auto; text-align: center; }
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 28px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.spec-strip {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin: 34px 0 0;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}
.spec-strip dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.spec-strip dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 1rem;
}

.hero-diagram { color: var(--circuit); }
.hero-diagram-svg { width: 100%; height: auto; overflow: visible; }
.node rect, .node circle, .node path, .node line {
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.node { color: var(--ink); }
.node-router rect { fill: var(--paper-raised); }
.pulse-dot { fill: var(--amber); stroke: none; animation: pulse-dot 2.2s ease-in-out infinite; }
.signal-line-base { stroke: var(--border); stroke-width: 1.5; stroke-dasharray: 4 5; fill: none; }
.signal-line-pulse {
  stroke: var(--amber);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw-in 1.1s ease-out forwards;
}
.signal-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  fill: var(--muted);
  letter-spacing: 0.04em;
}
@keyframes draw-in { to { stroke-dashoffset: 0; } }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-diagram { max-width: 360px; margin: 0 auto; }
}

/* ---------------------------- Services ---------------------------- */
.services { padding: 84px 0; background: var(--paper-raised); }
.services .eyebrow, .why .eyebrow, .contact .eyebrow { text-align: center; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  position: relative;
}
a.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
a.card:hover {
  border-color: var(--circuit);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -20px rgba(16, 24, 32, 0.35);
}
.card-icon {
  width: 30px;
  height: 30px;
  color: var(--circuit);
  margin-bottom: 14px;
  display: block;
}
.card-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.card-link {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--circuit);
  transition: gap 0.15s ease, color 0.15s ease;
}
a.card:hover .card-link { color: var(--amber-dark); gap: 9px; }

/* ---------------------------- Datasheet (Vì sao chọn) ---------------------------- */
.why { padding: 80px 0; background: var(--paper-band); }
.datasheet {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  max-width: 880px;
  margin: 0 auto;
}
.datasheet-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  padding: 22px 28px;
}
.datasheet-row + .datasheet-row { border-top: 1px dashed var(--border); }
.datasheet-row dt {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--circuit);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.datasheet-row dd { margin: 0; color: var(--text); font-size: 0.96rem; line-height: 1.6; }

@media (max-width: 640px) {
  .datasheet-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------------------------- Ảnh thực tế / minh hoạ ---------------------------- */
.gallery { padding: 80px 0; background: var(--paper-band); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.gallery-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-caption {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
}
.gallery-caption strong { color: var(--ink); font-family: var(--font-body); font-weight: 600; }

.photo-banner {
  margin: 0 0 60px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-banner img { width: 100%; height: 300px; object-fit: cover; display: block; }
.photo-banner-caption {
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: #fff;
}

/* ---------------------------- Tình huống thường gặp ---------------------------- */
.cases { padding: 80px 0; background: var(--paper-raised); }
.case-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.case-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  background: #fff;
  border-left: 3px solid var(--amber);
}
.case-item .case-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--amber-dark);
  margin-bottom: 8px;
  display: block;
}
.case-item p { margin: 0; color: var(--text); font-size: 0.95rem; line-height: 1.55; }

/* ---------------------------- Khu vực phục vụ ---------------------------- */
.area { padding: 80px 0; background: var(--paper-raised); }
.area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.area-copy .section-title { text-align: left; }
.area-copy p { color: var(--muted); max-width: 480px; }
.area-diagram { color: var(--circuit); text-align: center; }
.area-diagram svg { width: 100%; max-width: 280px; height: auto; }
.area-diagram-caption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 8px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--circuit);
  text-decoration: none;
  border-bottom: 1px dashed var(--circuit);
  padding-bottom: 2px;
  margin-top: 8px;
}
.text-link:hover { color: var(--amber-dark); border-color: var(--amber-dark); }

/* Trang dịch vụ con dùng bố cục đơn giản hơn (không có sơ đồ) */
.area-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.area-inner p { color: var(--muted); }
.area .breadcrumb-back {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--circuit);
  text-decoration: none;
}
.area .breadcrumb-back:hover { color: var(--amber-dark); }

/* ---------------------------- Contact ---------------------------- */
.contact { padding: 84px 0 96px; background: var(--paper); }
.contact-sub { text-align: center; color: var(--muted); margin-top: -6px; margin-bottom: 32px; }

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 30px;
  box-shadow: 0 24px 50px -34px rgba(16, 24, 32, 0.35);
}
.form-row { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.form-row label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.form-row input, .form-row select, .form-row textarea {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: var(--font-body);
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(226, 147, 46, 0.18);
}
.contact-form .btn { width: 100%; justify-content: center; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { text-align: center; margin-top: 14px; font-weight: 600; min-height: 1.2em; font-size: 0.94rem; }
.form-status.ok { color: var(--green); }
.form-status.err { color: #c0392b; }

/* ---------------------------- Footer ---------------------------- */
.site-footer {
  background: var(--ink);
  color: #c9d4dd;
  padding: 40px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.92rem;
}
.footer-brand strong { color: #fff; font-family: var(--font-display); }
.footer-contacts { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-contacts a { color: #fff; text-decoration: none; font-weight: 600; font-family: var(--font-mono); }
.footer-contacts a:hover { color: var(--amber); }
.footer-meta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #7c8b98;
}

/* ---------------------------- Sticky mobile call bar ---------------------------- */
.mobile-call-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--amber);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 -8px 22px rgba(16, 24, 32, 0.18);
}
.mobile-call-bar .status-dot { background: var(--ink); }

@media (max-width: 720px) {
  .mobile-call-bar { display: flex; }
  body { padding-bottom: 60px; }
}

@media (max-width: 640px) {
  .hero-copy h1 { font-size: 1.6rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-contacts { justify-content: center; }
  .area-grid { grid-template-columns: 1fr; }
  .area-copy .section-title { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot, .pulse-dot { animation: none !important; opacity: 1 !important; }
  .signal-line-pulse { animation: none !important; stroke-dashoffset: 0 !important; }
}
