:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-strong: #15191e;
  --text: #1f252b;
  --muted: #65717d;
  --line: #d7ded7;
  --primary: #1f6f78;
  --primary-dark: #174f56;
  --accent: #b85c2d;
  --success: #2f7d4e;
  --danger: #b64242;
  --shadow: 0 18px 45px rgba(31, 37, 43, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Noto Sans SC",
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--primary);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(246, 248, 245, 0.92);
  border-bottom: 1px solid rgba(215, 222, 215, 0.8);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.danger {
  border-color: rgba(182, 66, 66, 0.35);
  color: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.hero {
  min-height: min(760px, calc(100vh - 138px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 104px) clamp(24px, 7vw, 92px);
}

.hero h1,
.auth-panel h1,
.content-page h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-panel h1,
.content-page h1 {
  font-size: clamp(30px, 5vw, 48px);
}

.hero p,
.lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: #394550;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.hero-visual {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: clamp(28px, 5vw, 64px);
  background:
    radial-gradient(circle at 25% 18%, rgba(31, 111, 120, 0.18), transparent 34%),
    linear-gradient(135deg, #192025, #26372f 52%, #1b2729);
}

.preview-window {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(246, 248, 245, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.preview-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #edf2ee;
}

.preview-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #9aa8a0;
}

.graph-preview {
  position: relative;
  height: 300px;
  background:
    linear-gradient(rgba(31, 111, 120, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 120, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
}

.graph-node {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(31, 111, 120, 0.22);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 740;
  box-shadow: 0 8px 22px rgba(31, 37, 43, 0.1);
}

.node-primary {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary);
  color: #fff;
}

.node-company {
  background: #fff;
}

.node-company:nth-of-type(2) {
  left: 12%;
  top: 22%;
}

.node-company:nth-of-type(3) {
  right: 10%;
  top: 18%;
}

.node-institution {
  left: 15%;
  bottom: 20%;
  border-color: rgba(184, 92, 45, 0.34);
}

.node-capital {
  right: 12%;
  bottom: 18%;
  border-color: rgba(184, 92, 45, 0.34);
}

.graph-edge {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: rgba(31, 111, 120, 0.38);
}

.edge-a {
  width: 190px;
  left: 24%;
  top: 41%;
  transform: rotate(24deg);
}

.edge-b {
  width: 175px;
  left: 49%;
  top: 40%;
  transform: rotate(-22deg);
}

.edge-c {
  width: 230px;
  left: 30%;
  bottom: 31%;
  transform: rotate(-2deg);
}

.preview-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.preview-list div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  background: #fff;
}

.preview-list span {
  color: var(--muted);
  line-height: 1.5;
}

.section {
  padding: 54px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.auth-panel.compact {
  box-shadow: var(--shadow);
}

.feature-grid,
.contact-grid,
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature-card,
.price-card,
.auth-panel,
.device-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 37, 43, 0.08);
}

.feature-card,
.price-card {
  padding: 22px;
}

.feature-card h2,
.feature-card h3,
.price-card h2 {
  margin: 0;
  font-size: 20px;
}

.feature-card p,
.price-card p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-card p {
  margin-bottom: 0;
}

.contact-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.legal-footer {
  padding: 24px clamp(20px, 5vw, 72px) 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  background: #eef3ef;
}

.auth-shell,
.content-page {
  width: min(960px, calc(100vw - 40px));
  margin: 48px auto;
}

.auth-panel {
  padding: clamp(24px, 5vw, 42px);
}

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

label {
  display: grid;
  gap: 8px;
  color: #35414b;
  font-weight: 680;
}

input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(31, 111, 120, 0.16);
}

.status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.device-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.device-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.device-title {
  font-weight: 740;
}

.device-row code {
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero-visual {
    min-height: 260px;
    order: -1;
  }

  .graph-preview {
    height: 240px;
  }

  .graph-node {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .feature-grid,
  .contact-grid,
  .price-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .device-row {
    grid-template-columns: 1fr;
  }
}
