@font-face {
  font-family: "Golos Text";
  src: url("fonts/GolosText-Variable.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #10151e;
  --bar: #131a25;
  --panel: #171f2c;
  --field: #101722;
  --border: #344052;
  --outline: #526172;
  --text: #f1f5fa;
  --muted: #a6b3c6;
  --accent: #c7fb8b;
  --on-accent: #172115;
  --success: #c3f5a0;
  --error: #ffb7b6;
  --mono: "JetBrains Mono", monospace;
  font: 16px/1.5 "Golos Text", system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
code { font-family: var(--mono); }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.topbar {
  background: var(--bar);
  border-bottom: 1px solid var(--border);
}

.topbar__inner, .workspace {
  width: min(1120px, calc(100% - 80px));
  margin-inline: auto;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  min-height: 44px;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.brand__mark {
  display: block;
  flex: none;
  width: 44px;
  height: 32px;
  padding: 4px 5px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field);
}

.topbar__divider { height: 20px; width: 1px; background: var(--border); }
.topbar__label { color: var(--muted); font-size: 14px; }

.topbar__action { margin-inline-start: auto; }

.workspace { padding-block: 68px; }
.workspace__intro { margin-block-end: 36px; }
.workspace h1 { font-size: clamp(39px, 5vw, 58px); line-height: 1.08; font-weight: 660; letter-spacing: -.05em; }
.workspace__intro p { color: var(--muted); margin-top: 14px; max-width: 570px; }

.workspace__grid {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.pages { padding: 11px; }
.pages__title {
  font-size: 14px;
  font-weight: 650;
  margin: 9px 10px 11px;
  color: var(--muted);
}

.page-link {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 67px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
}

.page-link + .page-link { margin-top: 4px; }
.page-link:hover { background: var(--bar); }
.page-link[aria-current] { border-color: #4c6349; background: #232f2c; }

.page-mark {
  display: block;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  object-fit: contain;
  border-radius: 8px;
}

.page-mark--large { width: 56px; height: 56px; border-radius: 11px; }
.page-link__copy { flex: 1; min-width: 0; }
.page-link__copy strong { display: block; font-size: 15px; font-weight: 600; }
.page-link code, .editor__page code { color: var(--muted); font-size: 12px; }

.page-link__status {
  position: relative;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8494aa;
}

.page-link__status--set { background: var(--accent); }

.editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 27px 28px;
  border-bottom: 1px solid var(--border);
}

.editor__page { display: flex; align-items: center; gap: 14px; }
.editor__page h2 { font-size: 27px; line-height: 1.15; font-weight: 660; letter-spacing: -.03em; }
.editor__page code { display: block; margin-top: 5px; }
.integration-status { font-size: 13px; color: var(--muted); }

.editor__form { padding: 30px 28px 28px; }
.editor__label { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
label { font-size: 15px; font-weight: 620; }

.link-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: var(--bar);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.link-status::before { content: ""; height: 5px; width: 5px; border-radius: 50%; background: currentColor; }
.link-status--set { color: var(--success); background: #273b2c; }

.field {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--field);
  color: var(--text);
  font-size: 16px;
}

.field::placeholder { color: var(--muted); opacity: 1; }
.field[aria-invalid="true"] { border-color: var(--error); }
.field-help, .muted { color: var(--muted); }
.field-help { margin-top: 9px; font-size: 14px; }
.message { margin-top: 14px; font-size: 14px; }
.message--error { color: var(--error); }
.message--success { color: var(--success); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.button--primary { color: var(--on-accent); background: var(--accent); }
.button--primary:hover { background: #dcffb3; }
.button--ghost { background: transparent; border-color: var(--outline); color: var(--text); }
.button--ghost:hover { background: var(--bar); }
.editor__form .button--primary { margin-top: 25px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.login {
  width: min(440px, calc(100% - 36px));
  margin: min(12vh, 120px) auto 40px;
}

.login__card { padding: clamp(20px, 6vw, 34px); }
.login h1 { margin-bottom: 24px; font-size: 32px; letter-spacing: -.035em; line-height: 1.1; }
.login .field { margin: 8px 0 18px; }
.login .button { width: 100%; }

@media (max-width: 880px) {
  .workspace__grid { grid-template-columns: 230px minmax(0, 1fr); gap: 14px; }
  .topbar__inner, .workspace { width: calc(100% - 48px); }
  .editor__header, .editor__form { padding-inline: 21px; }
  .editor__header { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .topbar__inner, .workspace { width: calc(100% - 32px); }
  .topbar__inner { min-height: 62px; gap: 10px; }
  .topbar__divider, .topbar__label { display: none; }
  .workspace { padding-block: 36px 40px; }
  .workspace__intro { margin-bottom: 24px; }
  .workspace__intro p { font-size: 15px; }
  .workspace__grid { grid-template-columns: minmax(0, 1fr); }
  .pages { padding: 8px; }
  .page-link { min-height: 56px; }
  .page-mark { width: 34px; height: 34px; }
  .page-mark--large { width: 46px; height: 46px; }
  .editor__header, .editor__form { padding: 18px 16px; }
  .editor__page h2 { font-size: 23px; }
  .editor__form .button--primary { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .page-link { transition: background-color 150ms ease, border-color 150ms ease; }
}
