:root {
  --bg-primary: #0A0E14;
  --bg-secondary: #131A23;
  --surface: #1E2630;
  --text-primary: #F0F4F8;
  --text-secondary: #8891A6;
  --brand: #00FFAA;
  --accent: #00B8FF;
  --highlight: #FF8A00;
  --line: #26303D;
  --grid: rgba(255, 255, 255, 0.08);
  --font-heading: "Inter Tight", "Arial Black", Impact, sans-serif;
  --font-body: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", "Courier New", monospace;
  --container: 1240px;
  --radius: 0px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

.skip-link {
  position: fixed;
  top: -56px;
  left: 16px;
  z-index: 120;
  padding: 12px 20px;
  background: var(--brand);
  color: var(--bg-primary);
  font-weight: 800;
  text-decoration: none;
  border: 1px solid var(--bg-primary);
  transition: top 0.2s ease;
}

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

#main-content {
  scroll-margin-top: 130px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.container--narrow {
  max-width: 880px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0, transparent 72%, rgba(0, 255, 170, 0.04) 72%, rgba(0, 255, 170, 0.04) 73%, transparent 73%, transparent 100%),
    linear-gradient(to bottom, transparent 0, transparent 85%, var(--grid) 85%, var(--grid) 85.6%, transparent 85.6%);
}

.site-header__top {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.site-header__meta {
  white-space: nowrap;
}

.site-header__strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.site-header__strip-label {
  color: var(--highlight);
  font-weight: 700;
}

.site-header__strip span:not(:first-child)::before {
  content: "/";
  color: var(--line);
  margin-right: 10px;
}

.site-header__main {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px 20px 12px;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.site-header__brand:hover {
  text-decoration: none;
}

.site-header__brand-mark {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  padding: 6px 10px;
  background: var(--brand);
  color: var(--bg-primary);
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
  letter-spacing: -0.02em;
}

.site-header__brand-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.01em;
}

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

.site-nav__list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

.site-nav__link {
  display: block;
  padding: 12px 20px;
  color: var(--text-secondary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--brand);
  background: rgba(0, 255, 170, 0.05);
  text-decoration: none;
}

.site-nav__link[aria-current="page"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: linear-gradient(180deg, transparent, rgba(0, 255, 170, 0.06));
}

.nav-toggle {
  display: none;
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.08s linear;
}

.site-footer {
  position: relative;
  background: var(--bg-secondary);
  border-top: 1px solid var(--line);
  margin-top: 80px;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent) 40%, transparent 70%);
}

.site-footer__inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 56px 20px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.6fr;
  gap: 40px;
  align-items: start;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.site-footer__logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  color: var(--brand);
}

.site-footer__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.site-footer__heading {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.site-footer__links a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-footer__links a:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
  text-decoration: none;
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.site-footer__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.site-footer__trust {
  color: var(--text-secondary);
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease, color 0.2s ease;
}

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

.back-to-top:hover {
  background: var(--brand);
  color: var(--bg-primary);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
  font-size: 0.9rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "›";
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
}

.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--bento {
  grid-template-columns: 2fr 1fr;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
  box-shadow: 0 0 0 1px var(--brand);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: #00ffaa;
  border-color: #00ffaa;
  color: var(--bg-primary);
  box-shadow: 0 0 24px rgba(0, 255, 170, 0.3);
}

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

.btn-outline:hover {
  background: rgba(0, 184, 255, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.panel {
  background: var(--bg-secondary);
  padding: 24px;
  border-top: 2px solid var(--brand);
}

.theme-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
}

.theme-card--active {
  border-color: var(--brand);
  box-shadow: inset 0 2px 0 var(--brand);
}

.section-heading__overline {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.08;
  margin-bottom: 20px;
}

.section-title--accent {
  color: var(--text-primary);
  border-left: 4px solid var(--accent);
  padding-left: 16px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge--brand {
  background: rgba(0, 255, 170, 0.07);
  border-color: rgba(0, 255, 170, 0.5);
  color: var(--brand);
}

.badge--accent {
  background: rgba(0, 184, 255, 0.07);
  border-color: rgba(0, 184, 255, 0.5);
  color: var(--accent);
}

.badge--highlight {
  background: rgba(255, 138, 0, 0.1);
  border-color: rgba(255, 138, 0, 0.5);
  color: var(--highlight);
}

.figure {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.figure--16x9 {
  aspect-ratio: 16 / 9;
}

.figure--4x3 {
  aspect-ratio: 4 / 3;
}

.figure--1x1 {
  aspect-ratio: 1 / 1;
}

.figure__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
}

.data-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.data-value {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--text-primary);
}

.data-value--brand {
  color: var(--brand);
}

.data-value--accent {
  color: var(--accent);
}

.data-value--highlight {
  color: var(--highlight);
}

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

.text-brand {
  color: var(--brand);
}

.text-accent {
  color: var(--accent);
}

.text-highlight {
  color: var(--highlight);
}

.text-secondary {
  color: var(--text-secondary);
}

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

@media (max-width: 992px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 768px) {
  .site-header__top {
    justify-content: center;
  }

  .site-header__meta {
    display: none;
  }

  .site-header__main {
    justify-content: space-between;
    padding: 12px 20px;
  }

  .site-header__brand-text {
    font-size: 1.25rem;
  }

  .site-header__brand-mark {
    font-size: 1.3rem;
    padding: 4px 8px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

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

  .nav-toggle[aria-expanded="true"] {
    background: var(--brand);
    color: var(--bg-primary);
    border-color: var(--brand);
  }

  .nav-toggle__icon {
    position: relative;
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
  }

  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, top 0.2s ease;
  }

  .nav-toggle__icon::before {
    top: -5px;
  }

  .nav-toggle__icon::after {
    top: 5px;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .site-nav {
    display: none;
    border-top: 0;
  }

  .site-nav[data-open] {
    display: block;
    border-top: 1px solid var(--line);
  }

  .site-nav__list {
    flex-direction: column;
  }

  .site-nav__link {
    padding: 16px 20px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--line);
  }

  .site-nav__link[aria-current="page"] {
    border-left-color: var(--brand);
    border-bottom-color: var(--line);
  }

  .grid--bento {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 40px;
  }

  .site-footer__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .site-header__strip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .scroll-progress__bar {
    transition: none;
  }

  .skip-link {
    transition: none;
  }

  .back-to-top {
    transition: none;
  }
}
