:root {
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", "Menlo", Consolas, monospace;
  --paper: #F5F1E8;
  --paper-mid: #EAE4D6;
  --ink: #1F1A17;
  --ink-soft: #5B534D;
  --ink-faint: #8A8078;
  --line: #CBC2B4;
  --accent: #E5482D;
  --cyan: #0B6B6A;
  --amber: #D97A0D;
  --night: #07111C;
  --night-2: #0B1A28;
  --night-line: #1B3042;
  --night-soft: #AAB9C7;
  --neon: #B7FF3C;
  --orange: #FF5A1F;
  --cyan-bright: #42D9C8;
  --glass-white: rgba(255,255,255,0.65);
  --radius: 4px;
  --shadow: 0 20px 60px rgba(31,26,23,.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(31,26,23,0.035) 1px, transparent 1px) 0 0 / 140px 140px,
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
}

h1, h2, h3, h4, p, ul, ol, dl, dd {
  margin: 0;
}

ul, ol {
  padding-left: 1.2em;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

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

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

::selection {
  background: var(--accent);
  color: #fff;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 2000;
  padding: .6em 1em;
  background: var(--orange);
  color: #fff;
  border-radius: 2px;
  transform: translateY(-240%);
  transition: transform .2s;
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background:
    linear-gradient(180deg, rgba(183,255,60,0.04), transparent 70%),
    var(--night);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #F5F1E8;
}

.site-header :focus-visible {
  outline-color: var(--neon);
}

.header-inner {
  position: relative;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

.header-rail {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--night-line);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  color: var(--night-soft);
  text-transform: uppercase;
}

.header-rail__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-rail__item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px rgba(183,255,60,.8);
}

.header-rail__item:nth-child(2)::before {
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255,90,31,.8);
}

.header-rail__item:nth-child(3)::before {
  background: var(--cyan-bright);
  box-shadow: 0 0 8px rgba(66,217,200,.65);
}

.header-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: clamp(14px, 2.5vw, 26px) 0;
}

.drawer-toggle {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  color: #F5F1E8;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  transition: border-color .2s, background .2s;
}

.drawer-toggle:hover {
  border-color: var(--orange);
  background: rgba(255,90,31,0.08);
}

.drawer-toggle__box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 12px;
}

.drawer-toggle__line {
  height: 2px;
  background: var(--neon);
  transition: transform .2s, opacity .2s, background .2s;
}

.drawer-toggle[aria-expanded="true"] .drawer-toggle__line:first-child {
  transform: translateY(5px) rotate(45deg);
  background: var(--orange);
}

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

.drawer-toggle[aria-expanded="true"] .drawer-toggle__line:last-child {
  transform: translateY(-5px) rotate(-45deg);
  background: var(--orange);
}

.masthead {
  grid-column: 2;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  text-decoration: none;
}

.masthead__brand {
  font-size: clamp(1.9rem, 4.8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: .95;
  color: #fff;
}

.masthead__tagline {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--night-soft);
  text-transform: uppercase;
}

.header-vtag {
  grid-column: 3;
  justify-self: end;
  padding: 4px 10px;
  border: 1px solid rgba(255,90,31,.6);
  border-radius: 2px;
  background: rgba(255,90,31,.08);
  color: var(--orange);
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-weight: 900;
  line-height: 1.2;
  transform: skewX(-6deg);
}

.site-nav {
  border-top: 1px solid var(--night-line);
}

.nav-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 clamp(18px, 3vw, 46px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list__item {
  margin: 0;
  padding: 0;
}

.nav-list__link {
  display: inline-block;
  padding: 14px 2px 12px;
  border-bottom: 2px solid transparent;
  color: #B9C7D2;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s, border-color .2s;
}

.nav-list__link:hover {
  color: #fff;
  border-bottom-color: var(--neon);
}

.nav-list__link[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--orange);
}

.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--night-line);
}

.header-progress__bar {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--cyan-bright));
  box-shadow: 0 0 12px rgba(183,255,60,.45);
}

.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 120px);
  overflow: hidden;
  background: var(--night);
  color: #AAB9C7;
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), transparent 30%, var(--neon) 70%, var(--cyan-bright));
}

.site-footer::after {
  content: "TQB / DIRECT / V4";
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-family: var(--font-mono);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: rgba(255,255,255,0.025);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.footer-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr .7fr 1fr;
  gap: clamp(24px, 5vw, 72px);
  max-width: 1440px;
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px);
}

.footer-brand {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-brand__name {
  justify-self: start;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  transition: color .2s;
}

.footer-brand__name:hover {
  color: var(--neon);
}

.footer-brand__about {
  max-width: 52ch;
  color: #AAB9C7;
  font-size: .9375rem;
  line-height: 1.7;
}

.footer-brand__trust {
  max-width: 60ch;
  margin-top: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--neon);
  color: #7B93A6;
  font-size: .8125rem;
  line-height: 1.6;
}

.footer-links ul {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: #C8D4DF;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}

.footer-links a:hover {
  color: #fff;
  border-bottom-color: var(--neon);
}

.footer-links__title,
.footer-contact__title {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--neon);
}

.footer-contact {
  display: grid;
  align-content: start;
  gap: 4px;
}

.footer-contact__line {
  color: #AAB9C7;
  font-size: .875rem;
  line-height: 1.6;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255,255,255,.08);
}

.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1440px;
  margin-inline: auto;
  padding: 18px clamp(20px, 4vw, 48px);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .05em;
  color: #7B93A6;
}

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

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.page-shell {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.main-content {
  min-height: 65vh;
}

.section {
  padding-block: clamp(48px, 8vw, 96px);
}

.section-head {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin-bottom: clamp(28px, 5vw, 56px);
}

.section-index {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.section-summary {
  max-width: 60ch;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 32px);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-mid);
}

.panel--night {
  border-color: var(--night-line);
  background: var(--night-2);
  color: var(--night-soft);
}

.glass-panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-white);
  backdrop-filter: blur(8px);
}

.panel__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--accent);
}

.panel__title {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.panel--night .panel__title {
  color: #fff;
}

.panel__text {
  margin-top: 8px;
  color: var(--ink-soft);
}

.panel--night .panel__text {
  color: var(--night-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.4em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  text-decoration: none;
  transition: border-color .2s, background .2s, color .2s;
}

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

.btn--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

.btn--ghost {
  border-color: var(--ink-soft);
  color: var(--ink-soft);
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-soft);
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  margin: 0 .75em;
  color: var(--ink-faint);
}

.breadcrumbs__item a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

.data-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.data-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

.img-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--paper-mid), var(--line));
}

.img-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-55deg, transparent 0 8px, rgba(27,48,66,.08) 8px 9px);
}

.img-frame::after {
  content: "IMG / 16:9";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  color: var(--ink-faint);
}

.img-frame--hero,
.img-frame--wide {
  aspect-ratio: 21 / 9;
}

.img-frame--dark {
  border-color: var(--night-line);
  background: var(--night-2);
}

.img-frame--dark::after {
  color: var(--night-soft);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .drawer-toggle {
    display: none;
  }
}

@media (max-width: 899px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    border-top: 1px solid var(--night-line);
    background: var(--night-2);
    box-shadow: 0 30px 60px rgba(0,0,0,.45);
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    display: grid;
    gap: 0;
    padding: 8px;
  }

  .nav-list__link {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--night-line);
    border-left: 3px solid transparent;
  }

  .nav-list__link[aria-current="page"] {
    border-bottom-color: var(--night-line);
    border-left-color: var(--orange);
  }

  .nav-list__link:hover {
    border-left-color: var(--neon);
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 599px) {
  .header-rail {
    display: none;
  }

  .header-main {
    gap: 8px;
  }

  .drawer-toggle {
    padding: 8px;
  }

  .drawer-toggle__text {
    display: none;
  }

  .masthead__brand {
    font-size: 1.7rem;
  }

  .masthead__tagline {
    display: none;
  }

  .header-vtag {
    padding: 3px 8px;
    font-size: 1rem;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

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

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom__inner {
    justify-content: center;
    text-align: center;
  }
}

@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;
  }
}
