/* The site app's own frames: the help frame (.help), the plain document (.legal) and the not-found page (.nf).
   Colours are the chat's palette (apps/chat/src/app/globals.css, light :root and .dark) so the pages read as one
   product; the theme comes from <html data-theme>, set before first paint by Layout.astro (`seyka.theme`, shared
   with the chat and the developer docs). The Studio pages do not load this file. */

@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://static.seyka.ru/fonts/rubik-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://static.seyka.ru/fonts/rubik-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.129 0.042 264.695);
  --primary: oklch(0.208 0.042 265.755);
  --primary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --border: oklch(0.929 0.013 255.508);
  --wordmark: #312e81;
  --font-sans: 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
[data-theme='dark'] {
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --primary: oklch(0.929 0.013 255.508);
  --primary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --border: oklch(1 0 0 / 10%);
  --wordmark: #c7d2fe;
  color-scheme: dark;
}

*,
::before,
::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}

/* Brand: the cat mark (CatMascot variant="brand") and the Rubik wordmark, as in the chat. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand .cat {
  transform: rotate(-6deg);
}
.brand .cat .body {
  fill: var(--foreground);
}
.brand .cat .eye {
  fill: var(--background);
}
.brand .cat .nose {
  fill: #6366f1;
}
.brand-name {
  font-family: 'Rubik', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--wordmark);
}
.brand-sub {
  color: var(--muted-foreground);
  font-size: 14px;
}

/* Document text, shared by both frames. */
.prose {
  min-width: 0;
  overflow-wrap: break-word;
}
.prose h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.prose h2 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
  scroll-margin-top: 72px;
}
.prose h3 {
  font-size: 16px;
  margin: 24px 0 6px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 12px;
}
.prose ul,
.prose ol {
  padding-left: 22px;
}
.prose li {
  margin: 4px 0;
}
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}
.meta {
  color: var(--muted-foreground);
  font-size: 13px;
}
.lede {
  color: var(--muted-foreground);
  font-size: 17px;
  margin: 0 0 8px;
}

/* Help frame: top bar, the tree on the left, the page, its headings on the right. */
.help-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
  padding: 0 20px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
.help-top nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  font-size: 14px;
}
.help-top nav a {
  text-decoration: none;
  color: var(--muted-foreground);
}
.help-top nav a:hover {
  color: var(--foreground);
}
.help-top nav a.button {
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--muted);
}
.theme-toggle .moon,
[data-theme='dark'] .theme-toggle .sun {
  display: none;
}
[data-theme='dark'] .theme-toggle .moon {
  display: block;
}

.help-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 200px;
  max-width: 1280px;
  margin: 0 auto;
}
.help-tree {
  border-right: 1px solid var(--border);
  padding: 20px 12px;
}
.help-tree > summary {
  display: none;
}
.help-tree .group {
  margin: 14px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.help-tree .group:first-of-type {
  margin-top: 0;
}
.help-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.help-tree a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  color: var(--muted-foreground);
}
.help-tree a:hover {
  color: var(--foreground);
  background: var(--muted);
}
.help-tree a[aria-current='page'] {
  color: var(--foreground);
  background: var(--muted);
  font-weight: 600;
}
.help-main {
  padding: 32px 48px 64px;
  max-width: 760px;
}
.help-main .crumb {
  margin-bottom: 10px;
}
.help-main .crumb a {
  text-decoration: none;
}
.help-main .crumb a:hover {
  color: var(--foreground);
}
.help-toc {
  padding: 36px 16px 0 0;
}
.help-toc nav {
  position: sticky;
  top: 88px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  font-size: 13px;
}
.help-toc .meta {
  margin-bottom: 6px;
  font-weight: 600;
}
.help-toc a {
  display: block;
  padding: 3px 0;
  text-decoration: none;
  color: var(--muted-foreground);
}
.help-toc a:hover {
  color: var(--foreground);
}
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted-foreground);
}
.site-foot a {
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--foreground);
}

@media (max-width: 860px) {
  .help-top {
    gap: 12px;
    padding: 0 14px;
  }
  .help-top nav {
    gap: 12px;
  }
  .help-top nav .wide,
  .help-top .brand-sub {
    display: none;
  }
  .help-body {
    display: block;
  }
  .help-tree {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
  }
  .help-tree > summary {
    display: block;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .help-tree[open] > summary {
    padding-bottom: 4px;
  }
  .help-tree[open] {
    padding-bottom: 12px;
  }
  .help-main {
    padding: 24px 16px 48px;
  }
  .help-toc {
    display: none;
  }
  .prose h1 {
    font-size: 27px;
  }
}

/* Plain document (Terms, Privacy): logo, one narrow column, a footer line. */
.legal {
  max-width: 600px;
  margin: 0 auto;
  padding: 36px 20px 48px;
}
.legal > .brand {
  margin-bottom: 36px;
}
.legal .lede {
  font-size: 15px;
}
@media (max-width: 860px) {
  .legal {
    padding-top: 24px;
  }
  .legal > .brand {
    margin-bottom: 24px;
  }
}

/* Not-found page (src/pages/404.astro): the sey.kz stub's layout (docs/sey-kz-stub/404.html) in the chat's
   colours. The same page, kept in step by hand, is apps/chat/src/app/not-found.tsx and static/404.html, index.html. */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(https://static.seyka.ru/fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(https://static.seyka.ru/fonts/golos-text-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
.nf {
  min-height: 100vh;
  padding: 32px 20px;
  display: grid;
  place-items: center;
  font-family:
    'Golos Text',
    system-ui,
    -apple-system,
    sans-serif;
  line-height: normal;
}
.nf main {
  width: min(620px, 100%);
  text-align: center;
  animation: nf-rise 0.5s ease both;
}
@keyframes nf-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.nf .logo {
  display: inline-flex;
  border-radius: 16px;
  transition: transform 0.15s ease;
}
.nf .logo:hover {
  transform: rotate(-3deg) scale(1.03);
}
.nf .logo svg {
  display: block;
  width: 72px;
  height: 72px;
  transform: rotate(-6deg);
}
.nf .logo .body {
  fill: var(--foreground);
}
.nf .logo .eye {
  fill: var(--background);
}
.nf .logo .nose {
  fill: #6366f1;
}
.nf .code {
  margin: 34px 0 0;
  color: var(--primary);
  font-size: clamp(92px, 25vw, 176px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.78;
}
.nf h1 {
  margin: 24px 0 0;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.1;
}
.nf .cat-copy {
  max-width: 510px;
  margin: 18px auto 30px;
  color: var(--muted-foreground);
  font-size: 17px;
  line-height: 1.6;
}
.nf .actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nf .button {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease;
}
.nf .button:hover {
  opacity: 0.9;
}
.nf .button.secondary {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}
.nf .button.secondary:hover {
  opacity: 1;
  border-color: var(--primary);
}
.nf .button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 3px;
}
.nf footer {
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
}
@media (max-width: 440px) {
  .nf .actions {
    flex-direction: column;
  }
  .nf .button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nf main {
    animation: none;
  }
  .nf .logo {
    transition: none;
  }
}
