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

:root {
  --primary: #0A1F44;
  --primary-light: #122B4A;
  --primary-dark: #051226;
  --accent: #39FF14;
  --silver: #C0C0C0;
  --white: #FFFFFF;
  --warm-yellow: #FFB800;
  --neutral-light: #F5F7FA;
  --neutral-gray: #6B7280;
  --accent-deep: #2ECC40;
  --font-head: Impact, "Arial Black", "Noto Sans SC", sans-serif;
  --font-body: Inter, "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", monospace;
  --header-h: 72px;
  --content-max: 1200px;
  --radius: 4px;
  --clip-diagonal: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

html {
  scroll-behavior: smooth;
  background: var(--primary-dark);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(57, 255, 20, 0.04) 0%, rgba(10, 31, 68, 0.08) 40%, rgba(5, 18, 38, 0.15) 100%),
    var(--neutral-light);
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--accent-deep);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  background: var(--primary);
  color: var(--white);
  padding: 8px 16px;
  font-weight: 600;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(-140%);
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.skip-link:focus-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(5, 18, 38, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(192, 192, 192, 0.24);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(5, 18, 38, 0.96);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  fill: none;
  stroke-width: 2.2;
}

.brand-line-primary {
  stroke: var(--accent);
}

.brand-line-accent {
  stroke: var(--white);
  stroke-width: 1.6;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--white);
  text-transform: uppercase;
  line-height: 1;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 1px 5px;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 31, 68, 0.8);
  border: 1px solid rgba(192, 192, 192, 0.28);
  border-radius: 999px;
  padding: 6px 8px;
}

.nav-link {
  position: relative;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--silver);
  padding: 8px 14px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
  background: rgba(57, 255, 20, 0.1);
}

.nav-link[aria-current="page"] {
  color: var(--primary);
  background: var(--accent);
  font-weight: 700;
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(192, 192, 192, 0.4);
  background: rgba(10, 31, 68, 0.7);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Main ===== */
.page-main {
  padding-top: var(--header-h);
  min-height: 80vh;
}

/* ===== Common containers ===== */
.page-grid {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ===== Typography utilities ===== */
.section-index {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-index::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.section-index::after {
  content: "";
  width: 80px;
  height: 1px;
  background: var(--silver);
  display: inline-block;
  opacity: 0.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(40px, 6vw, 64px);
  text-transform: uppercase;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 20px;
}

h3 {
  font-size: clamp(22px, 3vw, 28px);
  margin-bottom: 12px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.text-large {
  font-size: 18px;
  line-height: 1.75;
}

.text-muted {
  color: var(--neutral-gray);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 14px 28px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border-color: var(--primary-light);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-white-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--silver);
}

.btn-white-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Data card ===== */
.data-card {
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: 8px;
  padding: 24px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 8px rgba(5, 18, 38, 0.04);
}

.data-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.data-card:hover,
.data-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(5, 18, 38, 0.18);
  border-color: rgba(57, 255, 20, 0.8);
}

.data-card:hover::before,
.data-card:focus-within::before {
  opacity: 1;
}

/* ===== Tag ===== */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
  gap: 4px;
}

.tag-accent {
  background: rgba(57, 255, 20, 0.15);
  color: var(--accent-deep);
  border: 1px solid rgba(57, 255, 20, 0.5);
}

.tag-yellow {
  background: rgba(255, 184, 0, 0.15);
  color: #9A6A00;
  border: 1px solid rgba(255, 184, 0, 0.6);
}

.tag-silver {
  background: rgba(192, 192, 192, 0.18);
  color: var(--neutral-gray);
  border: 1px solid var(--silver);
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Image mask placeholder ===== */
.image-mask {
  position: relative;
  background: var(--primary);
  clip-path: var(--clip-diagonal);
  overflow: hidden;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-mask::after {
  content: "IMG";
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 4px;
  color: rgba(192, 192, 192, 0.4);
  text-transform: uppercase;
}

.image-mask--accent::before {
  content: "";
  position: absolute;
  width: 60%;
  height: 120%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 6px,
    rgba(57, 255, 20, 0.12) 6px,
    rgba(57, 255, 20, 0.12) 12px
  );
  animation: scan 8s linear infinite;
}

.image-mask--light {
  background: var(--silver);
}

.image-mask--light::after {
  color: var(--primary);
}

@keyframes scan {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--primary-dark);
  color: var(--silver);
  border-top: 2px solid var(--accent);
  padding-top: 40px;
}

.footer-top {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px 28px;
  border-bottom: 1px solid rgba(192, 192, 192, 0.2);
}

.trust-statement {
  position: relative;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--silver);
  padding-left: 20px;
  margin: 0;
}

.trust-statement::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
}

.footer-logo .brand-name {
  font-size: 24px;
}

.footer-brand p {
  margin-top: 10px;
  font-size: 14px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.footer-address {
  margin-top: 16px;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.footer-heading {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(192, 192, 192, 0.2);
  padding-bottom: 6px;
}

.footer-heading-divider {
  margin-top: 8px;
}

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

.footer-quick:last-child {
  padding-left: 8px;
  border-left: 1px solid rgba(192, 192, 192, 0.2);
}

.footer-link {
  color: var(--silver);
  font-size: 14px;
  padding: 3px 0;
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(192, 192, 192, 0.18);
  padding: 16px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neutral-gray);
}

.copyright {
  margin: 0;
}

.icp {
  margin: 0;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: rgba(5, 18, 38, 0.85);
  color: var(--accent);
  font-size: 20px;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
}

/* ===== Mobile navigation ===== */
@media (max-width: 1024px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: flex;
    position: absolute;
    top: calc(var(--header-h) - 10px);
    right: 16px;
    left: 16px;
    max-width: 400px;
    margin-left: auto;
    flex-direction: column;
    align-items: stretch;
    background: rgba(5, 18, 38, 0.98);
    border-radius: 12px;
    padding: 12px;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  }

  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    width: 100%;
    border-radius: 8px;
    text-align: left;
    padding: 12px 16px;
    font-size: 15px;
  }

  .nav-link[aria-current="page"]::after {
    left: auto;
    right: 12px;
    width: 14px;
    height: 4px;
    bottom: 50%;
    transform: translateY(50%);
    background: var(--primary);
    border-radius: 2px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .page-grid {
    padding: 32px 16px;
    gap: 16px;
  }

  .content-container {
    padding: 32px 16px 60px;
  }

  .data-card {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .brand-version {
    display: none;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .footer-quick:last-child {
    padding-left: 0;
    border-left: 0;
  }

  .trust-statement {
    font-size: 13px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .image-mask--accent::before {
    animation: none;
  }
}

/* ===== Print ===== */
@media print {
  .site-header,
  .back-to-top,
  .nav-toggle {
    display: none !important;
  }

  .page-main {
    padding-top: 0;
  }

  body {
    background: var(--white);
    color: #000;
  }
}
