:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.075);
  --primary-blue: #2563eb;
  --primary-purple: #7c3aed;
  --accent-cyan: #06b6d4;
  --bitrix-blue: #2fc6f6;
  --onec-red: #ff4d4d;
  --onec-yellow: #ffc107;
  --success: #22c55e;
  --text-main: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --gradient-main: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 45%, rgba(37, 99, 235, 0.16), transparent 28%),
    radial-gradient(circle at 84% 22%, rgba(124, 58, 237, 0.16), transparent 24%),
    radial-gradient(circle at 70% 82%, rgba(6, 182, 212, 0.09), transparent 24%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  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: 42px 42px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 78%);
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 44px);
  backdrop-filter: blur(16px);
  background: rgba(11, 15, 25, 0.72);
  border-bottom: var(--glass-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-main);
  color: white;
  -webkit-text-fill-color: white;
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.35);
}

nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 30px);
  list-style: none;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.25s;
}

nav a:hover {
  color: var(--text-main);
}

.login-link {
  min-width: max-content;
  padding: 12px 24px;
  border: 1px solid rgba(6, 182, 212, 0.42);
  border-radius: 10px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(124, 58, 237, 0.36));
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.26);
  transition: all 0.25s;
}

.login-link:hover {
  border-color: rgba(255, 255, 255, 0.48);
  transform: translateY(-2px);
}

.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 86px 20px 50px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  margin-bottom: 24px;
  border-radius: 999px;
  color: var(--accent-cyan);
  background: rgba(37, 99, 235, 0.11);
  border: 1px solid rgba(37, 99, 235, 0.32);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1 {
  max-width: 1180px;
  margin-bottom: 24px;
  font-size: clamp(42px, 5vw, 78px);
  font-weight: 800;
  line-height: 1.08;
}

h1 span {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 780px;
  margin: 0 auto 38px;
  color: var(--text-secondary);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 54px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 24px;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-primary {
  color: white;
  background: var(--gradient-main);
  box-shadow: 0 16px 44px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  color: white;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-danger {
  color: white;
  background: rgba(255, 77, 77, 0.16);
  border: 1px solid rgba(255, 77, 77, 0.3);
}

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

.feature-row,
.projects-grid {
  width: min(100%, 1220px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.feature-card,
.project-card,
.panel {
  border-radius: 16px;
  background: var(--bg-card);
  border: var(--glass-border);
  backdrop-filter: blur(14px);
}

.feature-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  text-align: left;
  overflow: hidden;
  position: relative;
  transition: all 0.25s;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--gradient-main);
  opacity: 0.75;
}

.feature-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--bitrix-blue), var(--primary-blue));
}

.feature-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--onec-red), var(--onec-yellow));
}

.feature-card:hover,
.project-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 24px;
  font-weight: 800;
}

.feature-title {
  margin-bottom: 10px;
  color: white;
  font-size: 24px;
  font-weight: 800;
}

.feature-text {
  color: var(--text-secondary);
  font-size: 15px;
}

.content-section {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 82px 20px;
}

.section-kicker {
  margin-bottom: 12px;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-align: center;
}

.section-title {
  max-width: 860px;
  margin: 0 auto 48px;
  text-align: center;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.15;
  font-weight: 800;
}

.architecture {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.connections-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.connection-line {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 12 10;
  animation: lineFlow 3s linear infinite;
}

.connection-line.active {
  stroke: rgba(6, 182, 212, 0.65);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.55));
}

@keyframes lineFlow {
  to { stroke-dashoffset: -44; }
}

.hub {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(124, 58, 237, 0.25));
  border: 2px solid rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 80px rgba(37, 99, 235, 0.34);
  backdrop-filter: blur(16px);
  text-align: center;
}

.hub strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub span {
  display: block;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.arch-node {
  position: absolute;
  z-index: 4;
  width: 210px;
  padding: 22px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  text-align: center;
  transition: all 0.25s;
}

.arch-node:hover {
  transform: scale(1.04);
  border-color: rgba(6, 182, 212, 0.55);
}

.arch-node b {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.arch-node span {
  color: var(--text-secondary);
  font-size: 13px;
}

.arch-onec { top: 8%; left: 8%; border-top: 4px solid var(--onec-red); }
.arch-bitrix { top: 8%; right: 8%; border-top: 4px solid var(--bitrix-blue); }
.arch-team { bottom: 8%; left: 14%; border-bottom: 4px solid var(--accent-cyan); }
.arch-process { bottom: 8%; right: 14%; border-bottom: 4px solid var(--primary-purple); }

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 235px;
  padding: 26px;
  text-decoration: none;
  color: white;
  transition: all 0.25s;
}

.project-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.project-status {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.project-name {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 14px;
  flex: 1;
}

.project-link {
  margin-top: 18px;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  padding: 30px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: var(--glass-border);
  color: var(--text-secondary);
  text-align: center;
}

footer {
  padding: 34px 20px 46px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-body {
  min-height: 100vh;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 70px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.admin-title h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 48px);
}

.admin-title p,
.muted {
  color: var(--text-secondary);
}

.login-panel {
  width: min(430px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 30px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  gap: 7px;
}

label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: white;
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.tab-btn {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active,
.tab-btn:hover {
  color: white;
  border-color: rgba(6, 182, 212, 0.45);
  background: rgba(37, 99, 235, 0.22);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.panel {
  padding: 24px;
}

.project-list {
  display: grid;
  gap: 14px;
}

.admin-project {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-project h3 {
  font-size: 18px;
}

.admin-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.small-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.notice {
  margin-top: 14px;
  color: var(--accent-cyan);
  font-size: 14px;
  font-weight: 700;
}

.error {
  color: #ff8a8a;
}

@media (max-width: 980px) {
  header,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav ul {
    justify-content: flex-start;
  }

  .feature-row,
  .projects-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .architecture {
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .connections-svg {
    display: none;
  }

  .hub,
  .arch-node {
    position: static;
    width: 100%;
    height: auto;
    min-height: 120px;
    border-radius: 16px;
  }
}
