/* Giải Pháp Số Nova — Base Styles, Browser Surfaces, Layout Primitives & Shared Chrome */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  scrollbar-color: #B8C4D8 var(--bg);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #BCC7DA;
  border: 2px solid var(--bg);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8D9DB8;
}

::selection {
  background: var(--cobalt-tint);
  color: var(--navy);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  caret-color: var(--cobalt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--cobalt);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

a:hover {
  color: var(--cobalt-hover);
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Typography roles */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.09;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code, kbd, .mono {
  font-family: var(--font-mono);
}

kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Screen-reader & skip link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--on-dark);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 12px;
}

.skip-link:hover {
  background: var(--cobalt);
  color: #FFFFFF;
}

/* Container & vertical rhythm */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--sp-6);
  padding-right: var(--sp-6);
}

.section {
  padding-top: var(--sp-20);
  padding-bottom: var(--sp-20);
  border-top: 1px solid var(--line);
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + var(--sp-4));
}

.section--surface {
  background: var(--surface);
}

.section--navy {
  background: var(--navy);
  color: var(--on-dark);
  border-top-color: var(--navy-line);
}

.section--navy h2,
.section--navy h3 {
  color: var(--on-dark);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--sp-10);
}

.section-head p {
  margin-top: var(--sp-3);
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.6;
}

.section--navy .section-head p {
  color: var(--on-dark-2);
  letter-spacing: 0.005em;
  line-height: 1.65;
}

/* Shared SVG icon grammar (1.6px uniform stroke) */
.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico--sm {
  width: 15px;
  height: 15px;
}

.ico--lg {
  width: 22px;
  height: 22px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--cobalt);
  color: #FFFFFF;
  border-color: var(--cobalt);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--cobalt-hover);
  border-color: var(--cobalt-hover);
  color: #FFFFFF;
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  background: var(--surface-hover);
  border-color: #9FB0CC;
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.btn--on-dark {
  background: #FFFFFF;
  color: var(--navy);
  border-color: #FFFFFF;
}

.btn--on-dark:hover {
  background: var(--cobalt-tint);
  border-color: var(--cobalt-tint);
  color: var(--navy-deep);
}

.btn--on-dark-outline {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--navy-line);
}

.btn--on-dark-outline:hover {
  background: var(--navy-elevated);
  border-color: #5D83CA;
  color: #FFFFFF;
}

.btn--sm {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 0.875rem;
}

.btn--lg {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand__sub {
  font-size: 0.75rem;
  color: var(--ink-3);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--cobalt);
  border-bottom-color: var(--cobalt);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 95;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow-y: auto;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.mobile-drawer__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.mobile-drawer__links a:hover {
  color: var(--cobalt);
}

.mobile-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-10);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-10);
  padding-bottom: var(--sp-10);
  border-bottom: 1px solid var(--line);
}

.footer-brand-desc {
  margin-top: var(--sp-4);
  max-width: 38ch;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.65;
}

.footer-contact {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.footer-contact a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.footer-contact a:hover {
  color: var(--cobalt);
  text-decoration: underline;
}

.footer-col__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-3);
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-list a {
  font-size: var(--text-sm);
  color: var(--ink-2);
  text-decoration: none;
}

.footer-list a:hover {
  color: var(--cobalt);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
}

.footer-legal-links a {
  color: var(--ink-3);
  text-decoration: none;
}

.footer-legal-links a:hover {
  color: var(--cobalt);
  text-decoration: underline;
}

/* Status chips */
.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
}

.state-chip--live {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok-ink);
}

.state-chip--gold {
  background: var(--gold-bg);
  border-color: var(--gold-line);
  color: var(--gold-ink);
}

.state-chip--cobalt {
  background: var(--cobalt-tint);
  border-color: var(--cobalt-line);
  color: var(--cobalt);
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok-dot);
  flex-shrink: 0;
}

.state-dot--gold {
  background: var(--gold-signal);
}

/* Responsive chrome */
@media (max-width: 960px) {
  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-8);
  }
}

@media (max-width: 720px) {
  .btn--sm {
    min-height: 44px;
    padding: 10px 16px;
  }

  .footer-list {
    gap: 2px;
  }

  .footer-list a,
  .footer-legal-links a,
  .footer-contact a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
  }

  .footer-legal-links {
    gap: var(--sp-4);
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .section {
    padding-top: var(--sp-12);
    padding-bottom: var(--sp-12);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
}

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