:root {
  color-scheme: dark;
  --bg: #030406;
  --panel: rgba(18, 20, 25, 0.72);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f7fb;
  --muted: #a4acb9;
  --soft: #d8dde7;
  --accent: #f4f7ff;
  --shadow: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.10), transparent 24%),
    radial-gradient(circle at 82% 70%, rgba(116, 144, 205, 0.14), transparent 30%),
    radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.06), transparent 36%),
    #030406;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 750;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.84), transparent 88%);
  animation: gridDrift 18s linear infinite;
}

body::after {
  opacity: .46;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255,255,255,.10) 19%, transparent 20% 42%, rgba(112,139,205,.12) 43%, transparent 44% 100%),
    repeating-linear-gradient(135deg, transparent 0 74px, rgba(255,255,255,.055) 75px 77px, transparent 78px 150px);
  transform: translate3d(0,0,0);
  animation: lightSweep 14s cubic-bezier(.2,.8,.2,1) infinite alternate;
}

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

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(36px, 7vw, 76px);
  line-height: 0.98;
  font-weight: 950;
}

h2 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  font-weight: 950;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #030406;
  transition: opacity 520ms cubic-bezier(.2,.8,.2,1), visibility 520ms;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
  animation: loaderFloat 900ms cubic-bezier(.2,.8,.2,1) infinite alternate;
}

.loader-mark::before {
  content: "A";
  font-size: 34px;
  font-weight: 950;
}

.home-shell,
.cabinet-shell {
  position: relative;
  z-index: 1;
}

.home-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
}

.chain-bg {
  position: absolute;
  inset: auto 50% 7%;
  width: min(980px, 116vw);
  height: 260px;
  transform: translateX(50%);
  opacity: 0.42;
  filter: drop-shadow(0 26px 48px rgba(0,0,0,.46));
  animation: chainFloat 8s cubic-bezier(.2,.8,.2,1) infinite alternate;
  transition: opacity 220ms cubic-bezier(.2,.8,.2,1), filter 220ms;
  z-index: 0;
}

.chain-bg svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chain-link {
  fill: none;
  stroke: rgba(255,255,255,.56);
  stroke-width: 14;
  transition:
    transform 380ms cubic-bezier(.2,.8,.2,1),
    stroke 220ms,
    opacity 220ms;
  transform-box: fill-box;
  transform-origin: center;
}

.chain-bg:hover {
  opacity: 0.72;
  filter: drop-shadow(0 32px 72px rgba(0,0,0,.62));
}

.chain-bg:hover .chain-link {
  stroke: rgba(255,255,255,.86);
}

.chain-bg:hover .chain-link:nth-child(1) {
  transform: translate(-42px, -20px) rotate(-18deg);
}

.chain-bg:hover .chain-link:nth-child(2) {
  transform: translate(-20px, 28px) rotate(18deg);
}

.chain-bg:hover .chain-link:nth-child(3) {
  transform: translate(0, -26px) rotate(-16deg);
}

.chain-bg:hover .chain-link:nth-child(4) {
  transform: translate(24px, 26px) rotate(17deg);
}

.chain-bg:hover .chain-link:nth-child(5) {
  transform: translate(46px, -18px) rotate(-18deg);
}

.home-glass,
.cabinet-glass {
  position: relative;
  z-index: 1;
  width: min(100%, 960px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  box-shadow: 0 34px 110px var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter: blur(22px) saturate(140%);
  animation: riseIn 720ms cubic-bezier(.2,.8,.2,1) both;
}

.home-glass {
  display: grid;
  justify-items: center;
  gap: 30px;
  padding: clamp(34px, 8vw, 82px);
  text-align: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.home-glass--wide {
  max-width: 900px;
}

.home-actions,
.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 340ms cubic-bezier(.16,1,.3,1),
    box-shadow 340ms cubic-bezier(.16,1,.3,1),
    border-color 340ms,
    background 340ms,
    filter 340ms;
  will-change: transform;
}

.primary-button {
  background: #f6f7fb;
  color: #050609;
  box-shadow: 0 16px 42px rgba(255,255,255,.12);
}

.secondary-button,
.ghost-button {
  background: rgba(255,255,255,.075);
  color: var(--text);
}

.ghost-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.metric-button:hover {
  transform: translateY(-7px) scale(1.025);
  border-color: rgba(255,255,255,.34);
  filter: brightness(1.08);
  box-shadow: 0 24px 70px rgba(0,0,0,.46);
}

.why-list {
  display: grid;
  gap: 14px;
  width: min(100%, 760px);
  text-align: left;
  color: var(--soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.cabinet-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.cabinet-glass {
  width: min(100%, 1040px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  padding: 22px;
}

.cabinet-main,
.cabinet-banner {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 6, 9, 0.38);
}

.cabinet-main {
  padding: clamp(24px, 4vw, 42px);
}

.cabinet-banner {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 26px;
  background:
    linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.12)),
    radial-gradient(circle at 50% 22%, rgba(255,255,255,.18), transparent 32%),
    rgba(255,255,255,.055);
}

.cabinet-banner span,
.eyebrow,
.metric span,
.device-panel__head,
.device-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.cabinet-banner strong {
  font-size: 32px;
  line-height: 1.06;
  font-weight: 950;
  text-align: center;
}

.cabinet-lead {
  margin-top: 14px;
  color: var(--soft);
  font-size: 18px;
}

.referral-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  color: var(--soft);
  line-height: 1.45;
}

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 18px;
}

.metric {
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  transition: transform 340ms cubic-bezier(.16,1,.3,1), box-shadow 180ms;
}

.metric strong {
  font-size: clamp(18px, 3vw, 28px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.metric-button {
  cursor: pointer;
}

.device-panel {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  animation: softDrop 260ms cubic-bezier(.2,.8,.2,1) both;
}

.device-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.device-list {
  display: grid;
  gap: 10px;
}

.device-list article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
}

.hidden-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn 640ms cubic-bezier(.2,.8,.2,1) both;
}

.reveal:nth-child(2) {
  animation-delay: 70ms;
}

.reveal:nth-child(3) {
  animation-delay: 120ms;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softDrop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loaderFloat {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-8px) scale(1.04);
  }
}

@media (max-width: 840px) {
  .cabinet-glass {
    grid-template-columns: 1fr;
  }

  .cabinet-banner {
    min-height: 260px;
  }
}

@media (max-width: 560px) {
  .home-screen,
  .cabinet-shell {
    padding: 18px;
  }

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

  .cabinet-actions,
  .home-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

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

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 52px 52px, 52px 52px; }
}

@keyframes lightSweep {
  from { transform: translate3d(-3%, -2%, 0) scale(1.02); opacity: .34; }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); opacity: .58; }
}

@keyframes chainFloat {
  from { transform: translateX(50%) translateY(0) rotate(-1deg); }
  to { transform: translateX(50%) translateY(-18px) rotate(1deg); }
}
