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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-dark);
  background: var(--c-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--c-orange);
  color: var(--c-white);
}

:focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ========== VARIABLES ========== */
:root {
  --c-deep: #0A1F44;
  --c-orange: #FF6B00;
  --c-soft-orange: #FF9A5C;
  --c-green: #00E676;
  --c-green-deep: #00A854;
  --c-canvas: #F4F7FB;
  --c-gray: #8892A6;
  --c-dark: #0B1220;
  --c-border: #E6EAF2;
  --c-white: #FFFFFF;
  --font-head: "Source Han Sans SC Heavy", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Impact, sans-serif;
  --font-body: Verdana, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --radius-lg: 24px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --container: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ========== TYPOGRAPHY ========== */
h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--c-deep);
  font-weight: 900;
}

h1 {
  font-size: clamp(34px, 4.8vw, 56px);
  letter-spacing: .01em;
  margin-bottom: .35em;
}

h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: .01em;
  margin-bottom: .4em;
}

h3 {
  font-size: 22px;
  margin-bottom: .5em;
}

h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: .6em;
}

p {
  margin-bottom: 1em;
}

/* ========== SKIP LINK ========== */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 2200;
  padding: 10px 18px;
  background: var(--c-orange);
  color: var(--c-white);
  font-size: 14px;
  font-weight: 700;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 6px 20px rgba(255, 107, 0, .4);
  transition: top .25s var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--c-deep);
  color: var(--c-white);
  box-shadow: 0 4px 30px rgba(10, 31, 68, .3);
}

.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 5;
  background: linear-gradient(90deg, var(--c-orange) 0%, var(--c-orange) 72%, var(--c-green) 100%);
  transform: scaleX(0);
  transform-origin: left center;
}

.header-masthead {
  max-width: var(--container);
  margin: 0 auto;
  padding: 26px 24px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  transition: padding .3s var(--ease);
}

.header-masthead-aside {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.7;
  color: var(--c-gray);
  padding-bottom: 6px;
}

.header-masthead-aside--right {
  text-align: right;
}

.header-edition-label {
  color: rgba(255, 255, 255, .6);
  font-weight: 700;
}

.header-match-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--c-gray);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 0 0 rgba(0, 230, 118, .55);
  animation: statusPulse 2.4s infinite;
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 230, 118, .55);
  }
  65% {
    box-shadow: 0 0 0 9px rgba(0, 230, 118, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
  }
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-glyph {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c-orange), var(--c-soft-orange));
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(255, 107, 0, .34);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 24px;
  color: var(--c-white);
  transform: rotate(-6deg);
  transition: width .3s var(--ease), height .3s var(--ease), font-size .3s var(--ease);
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--c-white);
  transition: font-size .3s var(--ease);
}

.header-nav-wrap {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(2, 9, 22, .28);
}

.header-nav-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 14%;
  max-width: 180px;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 0, .08) 55%, rgba(255, 107, 0, .18));
  pointer-events: none;
}

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

.nav-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 12px 20px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  transition: background .2s, color .2s;
}

.nav-link:hover {
  color: var(--c-white);
  background: rgba(255, 255, 255, .08);
}

.nav-link[aria-current="page"] {
  color: var(--c-white);
  background: var(--c-orange);
  box-shadow: 0 6px 18px rgba(255, 107, 0, .38);
}

.nav-toggle {
  display: none;
}

.nav-toggle-line {
  display: block;
}

.nav-toggle-label {
  display: none;
}

.site-header[data-scrolled] .header-masthead {
  padding-top: 14px;
  padding-bottom: 12px;
}

.site-header[data-scrolled] .brand-name {
  font-size: 24px;
}

.site-header[data-scrolled] .brand-glyph {
  width: 38px;
  height: 38px;
  font-size: 19px;
}

/* ========== FOOTER ========== */
.site-footer {
  position: relative;
  margin-top: 96px;
  background:
    radial-gradient(circle at 88% 92%, rgba(255, 107, 0, .16) 0%, rgba(255, 107, 0, 0) 40%),
    radial-gradient(circle at 10% 8%, rgba(0, 230, 118, .08) 0%, rgba(0, 230, 118, 0) 34%),
    var(--c-deep);
  color: var(--c-white);
}

.site-footer::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg,
    var(--c-orange) 0%, var(--c-orange) 42%,
    var(--c-green) 42%, var(--c-green) 48%,
    transparent 48%, transparent 100%);
}

.footer-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 24px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1.1fr;
  gap: 48px;
  position: relative;
  z-index: 1;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-brand .brand-glyph {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-radius: 13px;
}

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

.footer-trust {
  max-width: 42ch;
  color: rgba(255, 255, 255, .55);
  font-size: 14px;
  line-height: 1.9;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-green);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
}

.footer-link {
  display: inline-block;
  padding: 5px 0;
  color: rgba(255, 255, 255, .72);
  font-size: 15px;
  line-height: 1.6;
  transition: color .2s, transform .2s var(--ease);
}

.footer-link:hover {
  color: var(--c-orange);
  transform: translateX(5px);
}

.footer-contact {
  color: rgba(255, 255, 255, .58);
  font-size: 14px;
  line-height: 2;
  margin-bottom: 0;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.footer-copyright,
.footer-icp {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .42);
}

/* ========== CONTENT LAYOUT ========== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

.section {
  padding: 72px 0;
}

.section--tight {
  padding: 44px 0;
}

.chapter-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-orange);
  margin-bottom: 12px;
}

.chapter-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--c-border), transparent);
}

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--c-gray);
  margin-bottom: 28px;
}

.breadcrumbs a {
  color: var(--c-deep);
  transition: color .2s;
}

.breadcrumbs a:hover {
  color: var(--c-orange);
}

.breadcrumbs-sep {
  margin: 0 10px;
  color: var(--c-gray);
}

/* ========== GRID ========== */
.grid {
  display: grid;
  gap: 24px;
}

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

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

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

@media (max-width: 1080px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 0;
  background: var(--c-orange);
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s var(--ease), box-shadow .2s, color .2s;
}

.btn:hover {
  background: #E85F00;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 107, 0, .3);
}

.btn:active {
  transform: translateY(0);
}

.btn--green {
  background: var(--c-green);
  color: var(--c-deep);
}

.btn--green:hover {
  background: var(--c-green-deep);
  color: var(--c-white);
  box-shadow: 0 10px 24px rgba(0, 230, 118, .28);
}

.btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--c-deep);
  color: var(--c-deep);
}

.btn--ghost:hover {
  background: var(--c-deep);
  color: var(--c-white);
  box-shadow: none;
  transform: translateY(-2px);
}

/* ========== CARDS ========== */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--c-soft-orange);
  box-shadow: 0 16px 40px rgba(10, 31, 68, .12);
}

.card--accent {
  border-top: 5px solid var(--c-orange);
}

.card__title {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 900;
  color: var(--c-deep);
  margin-bottom: 10px;
}

.card__text {
  color: var(--c-dark);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 0;
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--c-canvas);
  border: 1px solid var(--c-border);
  color: var(--c-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
}

.badge--orange {
  background: var(--c-orange);
  border-color: var(--c-orange);
  color: var(--c-white);
}

.badge--green {
  background: var(--c-green);
  border-color: var(--c-green);
  color: var(--c-deep);
}

/* ========== IMAGE FRAME ========== */
.image-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--c-deep) 0%, #1a3a75 55%, rgba(0, 230, 118, .25) 100%);
}

.image-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(120deg, rgba(255, 107, 0, .22) 0%, transparent 36%, rgba(255, 107, 0, .12) 68%, rgba(0, 230, 118, .18) 100%);
  pointer-events: none;
}

/* ========== RESPONSIVE HEADER ========== */
@media (max-width: 860px) {
  .header-masthead {
    grid-template-columns: 1fr;
    justify-items: start;
    align-items: center;
    padding: 14px 20px 12px;
    gap: 12px;
  }

  .header-masthead-aside {
    display: none;
  }

  .header-brand {
    gap: 10px;
  }

  .brand-glyph {
    width: 38px;
    height: 38px;
    font-size: 19px;
    border-radius: 13px;
  }

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

  .header-nav-wrap {
    padding-bottom: 4px;
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
    padding: 10px 8px 8px;
    border-radius: 12px;
    color: var(--c-white);
    transition: background .2s;
  }

  .nav-toggle:hover {
    background: rgba(255, 255, 255, .08);
  }

  .nav-toggle-line {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--c-white);
    transition: transform .25s var(--ease), opacity .2s;
  }

  .nav-toggle-label {
    display: block;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .16em;
    color: rgba(255, 255, 255, .45);
  }

  .site-nav[data-open] .nav-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-nav[data-open] .nav-toggle-line:nth-child(2) {
    opacity: 0;
  }

  .site-nav[data-open] .nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav[data-open] .nav-toggle-label {
    color: var(--c-orange);
  }

  .nav-list {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 4px 0 14px;
  }

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

  .nav-link {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 14px;
    text-align: left;
  }
}

/* ========== RESPONSIVE FOOTER ========== */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 48px 24px 32px;
  }

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

@media (max-width: 640px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 40px 20px 28px;
  }

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

  .footer-bottom {
    flex-direction: column;
    padding: 16px 20px;
  }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
