/* =========================================================
   PCLA — base.css
   tokens / reset / layout / buttons / header / footer / utils
   ========================================================= */

:root {
  --bg: #060a12;
  --bg-2: #080e1a;
  --panel: rgba(14, 24, 42, 0.66);
  --panel-2: #0b1424;
  --text: #eaf2ff;
  --muted: #93a8c8;
  --dim: #5d7292;
  --line: rgba(126, 170, 255, 0.14);
  --line-strong: rgba(126, 170, 255, 0.28);
  --accent: #4f9dff;
  --accent-2: #6ff0c8;
  --accent-3: #a78bfa;
  --accent-ink: #04101f;
  --btn-grad: linear-gradient(135deg, #5aa8ff, #2f7fe0);
  --btn-glow: rgba(79, 157, 255, 0.45);
  --grad: linear-gradient(110deg, var(--accent), var(--accent-2));
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  --radius: 20px;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", "Roboto Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eff4fc;
  --bg-2: #e7eef9;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-2: #ffffff;
  --text: #0a1730;
  --muted: #4f6483;
  --dim: #7b8da7;
  --line: rgba(20, 58, 118, 0.12);
  --line-strong: rgba(20, 58, 118, 0.22);
  --accent: #2563eb;
  --accent-2: #0f9d8a;
  --accent-3: #7c5cf0;
  --accent-ink: #ffffff;
  --btn-grad: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --btn-glow: rgba(37, 99, 235, 0.32);
  --shadow: 0 30px 70px -34px rgba(20, 50, 100, 0.32);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 700px at 82% -10%, rgba(79, 157, 255, 0.12), transparent 62%),
    radial-gradient(900px 600px at 0% 40%, rgba(111, 240, 200, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="light"] body {
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(800px 600px at -10% 40%, rgba(15, 157, 138, 0.09), transparent 60%),
    var(--bg);
}

body.has-menu {
  overflow: hidden;
}

::selection {
  background: rgba(79, 157, 255, 0.35);
  color: var(--text);
}

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

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

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  padding: 0.15em 0.42em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(126, 170, 255, 0.07);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

[data-theme="light"] code {
  color: #0b7f70;
  background: rgba(15, 157, 138, 0.08);
}

strong {
  font-weight: 700;
}

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

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

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

::-webkit-scrollbar-thumb {
  background: rgba(126, 170, 255, 0.22);
  border: 2px solid var(--bg);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 170, 255, 0.4);
}

/* ---------- layout ---------- */

.container {
  width: min(1200px, calc(100% - 56px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: 112px 0;
}

.section-head {
  max-width: 780px;
  margin-bottom: 56px;
}

.section-head h2 {
  margin-top: 18px;
  font-size: clamp(2.15rem, 4vw, 3.35rem);
  line-height: 1.06;
}

.section-head p {
  max-width: 620px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.02rem;
}

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

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.kicker i {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ---------- utility ---------- */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hide-sm {
  display: inline-flex;
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-2);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid var(--accent-2);
  border-radius: 50%;
  animation: pulseRing 2.4s ease-out infinite;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.tag.accent {
  color: var(--accent-2);
  border-color: rgba(111, 240, 200, 0.3);
  background: rgba(111, 240, 200, 0.06);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.25s, border-color 0.25s, gap 0.25s;
}

.text-link .ico {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.text-link:hover {
  gap: 12px;
  color: var(--accent);
  border-color: var(--accent);
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  transition: top 0.2s;
}

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

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn > * {
  position: relative;
  z-index: 2;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn-primary {
  background: var(--btn-grad);
  color: #fff;
  box-shadow: 0 14px 34px -12px var(--btn-glow), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 20px 44px -14px var(--btn-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-soft {
  border-color: var(--line-strong);
  background: rgba(126, 170, 255, 0.05);
  color: var(--text);
}

.btn-soft:hover {
  border-color: rgba(126, 170, 255, 0.5);
  background: rgba(126, 170, 255, 0.1);
}

[data-theme="light"] .btn-soft {
  background: rgba(255, 255, 255, 0.6);
}

.btn-sm {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 14.5px;
}

.btn-xl {
  gap: 12px;
  padding: 16px 24px;
  border-radius: 15px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn .ico {
  width: 17px;
  height: 17px;
}

.btn-download {
  align-items: center;
  gap: 13px;
  padding-left: 16px;
}

.btn-ico {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.btn-ico .ico {
  width: 19px;
  height: 19px;
}

.btn-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.2;
  text-align: left;
}

.btn-lines b {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0;
}

.btn-lines small {
  opacity: 0.78;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.btn-shine {
  position: absolute;
  top: -50%;
  left: 0;
  z-index: 1;
  width: 42%;
  height: 200%;
  background: linear-gradient(100deg, transparent 10%, rgba(255, 255, 255, 0.32) 50%, transparent 90%);
  transform: translateX(-180%) rotate(8deg);
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-download:hover .btn-shine {
  transform: translateX(330%) rotate(8deg);
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
}

[data-theme="light"] .site-header.scrolled {
  background: rgba(239, 244, 252, 0.78);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 34px;
  height: 78px;
  transition: height 0.3s ease;
}

.site-header.scrolled .header-inner {
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
}

.brand-mark .cube-svg {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 4px 10px rgba(79, 157, 255, 0.35));
}

.brand-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 157, 255, 0.35), transparent 70%);
  filter: blur(8px);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.brand-copy b {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  position: relative;
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.25s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(126, 170, 255, 0.04);
  color: var(--muted);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s;
}

.icon-btn .ico {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(126, 170, 255, 0.09);
  color: var(--text);
}

.menu-btn {
  display: none;
}

.header-download {
  margin-left: 2px;
}

.header-download .ico {
  width: 14px;
  height: 14px;
}

/* ---------- mobile menu ---------- */

.mobile-menu {
  position: fixed;
  top: 78px;
  left: 0;
  width: 100%;
  max-height: calc(100dvh - 78px);
  padding: 18px 28px 30px;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.96);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

[data-theme="light"] .mobile-menu {
  background: rgba(243, 247, 253, 0.97);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.mobile-menu nav a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.mobile-menu nav a span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
}

.mobile-menu .btn {
  margin-top: 4px;
}

.mobile-menu-note {
  margin-top: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-align: center;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  padding: 84px 0 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 70px;
}

.footer-brand p {
  max-width: 330px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.footer-social {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

.footer-social a {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}

.footer-social a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.footer-social .ico {
  width: 15px;
  height: 15px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.footer-links h4 {
  margin-bottom: 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.footer-links a {
  display: block;
  width: fit-content;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.2s, transform 0.2s;
}

.footer-links a:hover {
  transform: translateX(3px);
  color: var(--text);
}

.footer-wordmark {
  margin-top: 54px;
  font-size: clamp(5rem, 17vw, 13rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.72;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  opacity: 0.75;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  max-width: 720px;
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.8;
}

.footer-tech {
  flex: none;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(8, 15, 28, 0.94);
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.7);
  color: #eaf2ff;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-ico {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  background: rgba(79, 157, 255, 0.14);
  color: var(--accent);
}

.toast-ico .ico {
  width: 14px;
  height: 14px;
}

.toast-success .toast-ico {
  background: rgba(111, 240, 200, 0.14);
  color: var(--accent-2);
}

.toast-warn .toast-ico {
  background: rgba(255, 196, 107, 0.14);
  color: #ffc46b;
}

.toast-error .toast-ico {
  background: rgba(255, 107, 107, 0.14);
  color: #ff8080;
}

/* ---------- reveal / motion ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s ease,
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 0.7; }
  70% { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

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

/* ---------- responsive base ---------- */

@media (max-width: 1080px) {
  .container {
    width: min(1200px, calc(100% - 44px));
  }

  .site-nav {
    gap: 20px;
  }

  .header-inner {
    gap: 24px;
  }
}

@media (max-width: 960px) {
  .site-nav,
  .header-download {
    display: none;
  }

  .menu-btn {
    display: inline-grid;
  }

  .header-inner {
    height: 68px;
  }

  .mobile-menu {
    top: 68px;
    max-height: calc(100dvh - 68px);
  }

  .section {
    padding: 84px 0;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .footer-wordmark {
    margin-top: 44px;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 36px);
  }

  .section {
    padding: 68px 0;
  }

  .section-head {
    margin-bottom: 38px;
  }

  .section-head h2 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .brand-copy small {
    display: none;
  }

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

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

  .header-actions {
    gap: 7px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
  }

  .toasts {
    right: 12px;
    bottom: 92px;
    left: 12px;
  }

  .toast {
    max-width: none;
    width: 100%;
  }
}
