/* Главная «/» — перенос макета заказчика (доска «Sq BIM · вход», 1440 × 900). Без React и сборки.
   Шрифты (решение заказчика): Inter 500 вместо Space Grotesk / Inter Tight, JetBrains Mono Regular 400 (OFL — public/fonts/jetbrains-mono/OFL.txt).
   Внешних шрифтов нет (CSP). Тёмная тема — по настройке системы: спокойная инверсия тех же тонов, акцент тот же. */
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.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; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #E4E4E1;
  --card: #F2F2F0;
  --ink: #111111;
  --muted: #5F5F5A;
  --soft: #8E8E89;
  --line: #D9D9D5;
  --grid: #C4C4BF;
  --chip: #E0E0DC;
  --on-ink: #F2F2F0;
  --accent: #FF4D07;
  --on-accent: #111111;
  --handle: #FFFFFF;
  --select: #1f6feb;
  --ui: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #151514;
    --card: #1D1D1B;
    --ink: #ECECE8;
    --muted: #9A9A94;
    --soft: #6F6F6A;
    --line: #2E2E2B;
    --grid: #3A3A36;
    --chip: #2A2A27;
    --on-ink: #151514;
    --handle: #1D1D1B;
    --select: #5b9bff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--ink); }
a:hover { color: var(--muted); }
/* Вошёл / не вошёл: метку data-auth на <body> меняет Worker. */
body[data-auth="out"] .only-in,
body[data-auth="in"] .only-out { display: none !important; }
@media (max-width: 640px) { .hide-s { display: none !important; } }

.page { font-family: var(--ui); color: var(--ink); background: var(--bg); padding: clamp(8px, 1.6vw, 24px); min-height: 100vh; display: flex; }
.sheet { flex: 1; max-width: 1400px; margin: 0 auto; background: var(--card); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }

/* Шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; }
.brand { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.logo { display: block; }
.brand-name { font-family: var(--ui); font-size: 15px; font-weight: 500; }
.tag { letter-spacing: 0.04em; }
.muted { color: var(--muted); }

.body { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }

/* Левая часть */
.left { flex: 1.1 1 520px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.facts { margin: 0; padding: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); gap: 22px 48px; font-family: var(--mono); font-size: 11px; line-height: 1.4; }
.fact { display: flex; flex-direction: column; gap: 6px; }
.fact dt, .fact dd { margin: 0; }
.fact dd { display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--soft); display: block; flex: none; }
.dot-on { background: var(--ink); }

.enter { margin-top: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; background: var(--card); }
h1 { margin: 0; max-width: 380px; font-family: var(--ui); font-weight: 500; font-size: 13px; line-height: 1.35; letter-spacing: 0.05em; text-transform: uppercase; }

.login { display: flex; align-items: stretch; background: var(--ink); color: var(--on-ink); text-decoration: none; min-height: clamp(88px, 12vh, 120px); }
.login:hover { color: var(--on-ink); }
.login:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.login-text { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 20px; }
.login-cap { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.login-word { font-family: var(--ui); font-weight: 500; font-size: clamp(32px, 3.4vw, 52px); line-height: 0.85; letter-spacing: -0.02em; text-transform: uppercase; }
.arr { flex: none; aspect-ratio: 1 / 1; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.arr svg { display: block; transition: transform 0.25s ease; }
.login:hover .arr svg, .login:focus-visible .arr svg { transform: translateX(6px); }

.below { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.below > * { padding: 6px 0; }
.below-link { color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--muted); }
.linkbtn[disabled] { opacity: 0.5; cursor: default; }
.below a:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }
.who { overflow-wrap: anywhere; }

/* Правое поле: сетка точек, оси, объект */
.field { flex: 1 1 440px; min-width: 0; min-height: 440px; position: relative; overflow: hidden; background-color: var(--card); background-image: radial-gradient(var(--grid) 1px, transparent 1.2px); background-size: 18px 18px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; }
.axis { position: absolute; background: var(--ink); opacity: 0.18; }
.axis-x { left: 0; right: 0; top: 50%; height: 1px; }
.axis-y { top: 0; bottom: 0; left: 50%; width: 1px; }
.chips { position: absolute; left: 20px; top: 20px; display: flex; gap: 6px; }
.chip { background: var(--chip); padding: 5px 8px; }
.chip-z { background: var(--ink); color: var(--on-ink); }
.obj { position: absolute; left: 50%; top: 50%; width: min(44%, 330px); aspect-ratio: 1 / 1; transform: translate(-50%, -50%); }
.ghost { position: absolute; left: 14%; top: -14%; width: 100%; height: 100%; border: 1px dashed var(--soft); box-sizing: border-box; }
.solid { position: absolute; inset: 0; background: var(--ink); }
.lbl { position: absolute; color: var(--muted); }
.lbl-move { left: 14%; top: calc(-14% - 22px); }
.lbl-size { left: 0; bottom: -24px; }
.h { position: absolute; width: 9px; height: 9px; background: var(--handle); border: 1px solid var(--ink); box-sizing: border-box; }
.h-tl { left: -5px; top: -5px; }
.h-tr { right: -5px; top: -5px; }
.h-bl { left: -5px; bottom: -5px; }
.h-br { right: -5px; bottom: -5px; }
.foot { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; justify-content: space-between; color: var(--muted); }

/* Телефон (до 640 px) — мобильная доска заказчика (Mobile.dc.html, 390 × 844): фон листа во весь экран без рамки и скруглений,
   шапка, поле в точку на всё свободное место, внизу заголовок, кнопка 80 px и «Регистрация». Четырёх фактов и «ENTER ↵» на телефоне нет.
   Ровно 100svh, без прокрутки. Верх и низ учитывают вырез и жест «домой» (env(safe-area-inset-*), нужен viewport-fit=cover). Десктоп не затронут. */
@media (max-width: 640px) {
  :root { --grid: #C9C9C4; }
  body { background: var(--card); }
  .page { padding: 0; height: 100vh; height: 100svh; min-height: 0; background: var(--card); }
  .sheet { max-width: none; border-radius: 0; min-height: 0; }

  .top { padding: max(16px, calc(env(safe-area-inset-top, 0px) + 12px)) 20px 14px; }
  .brand { gap: 7px; min-height: 0; }
  .logo { width: 52px; height: 16px; }
  .brand-name { font-size: 14px; }

  .body { flex-wrap: nowrap; flex-direction: column; min-height: 0; }
  .left { display: contents; }
  .facts, .hint { display: none !important; }

  .field { order: 1; flex: 1 1 0; min-height: 0; font-size: 9px; }
  .axis { opacity: 0.14; }
  .chips { left: 20px; top: 18px; gap: 5px; }
  .chip { padding: 4px 7px; }
  .obj { width: 132px; height: 132px; aspect-ratio: auto; }
  .ghost { left: 18px; top: -18px; width: 132px; height: 132px; }
  .lbl { white-space: nowrap; }
  .lbl-move { left: 18px; top: -38px; }
  .lbl-size { bottom: -20px; }
  .h { width: 8px; height: 8px; }
  .h-tl { left: -4px; top: -4px; }
  .h-tr { right: -4px; top: -4px; }
  .h-bl { left: -4px; bottom: -4px; }
  .h-br { right: -4px; bottom: -4px; }
  .foot { left: 20px; right: 20px; bottom: 14px; }

  .enter { order: 2; margin-top: 0; padding: 24px 20px calc(34px + env(safe-area-inset-bottom, 0px)); gap: 18px; border-top: 1px solid var(--line); }
  h1 { max-width: 300px; font-size: 12px; line-height: 1.4; }
  .login { min-height: 0; height: 80px; }
  .login-text { padding: 13px 16px; }
  .login-cap { font-size: 9px; }
  .login-word { font-size: 32px; }
  .arr { flex: none; width: 80px; aspect-ratio: auto; }
  .arr svg { width: 24px; height: 24px; }
  .login:hover .arr svg, .login:focus-visible .arr svg { transform: translateX(5px); }
  .below { justify-content: flex-start; }
  .below > * { padding: 6px 0; position: relative; }
  /* Область касания шире видимого текста — без сдвига вёрстки */
  .below-link::after { content: ''; position: absolute; inset: -10px -6px; }
}
@media (max-width: 640px) and (prefers-color-scheme: dark) { :root { --grid: #3A3A36; } }

@media (prefers-reduced-motion: reduce) { .arr svg { transition: none; } }
