/* ============================================================
   AVatar Сайты · направление B «Янтарный терминал» (ДНК 12)
   Скетч 2 экранов · тёплый почти-чёрный + янтарь-индикатор
   ============================================================ */

/* ---------- Шрифты (self-hosted, кириллица + латиница) ---------- */
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/golos-text-400-cyrillic.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; font-display: swap;
  src: url('fonts/golos-text-400-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; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/golos-text-500-cyrillic.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: 500; font-display: swap;
  src: url('fonts/golos-text-500-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; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/golos-text-600-cyrillic.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: 600; font-display: swap;
  src: url('fonts/golos-text-600-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; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ibm-plex-mono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ibm-plex-mono-400-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; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/ibm-plex-mono-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/ibm-plex-mono-500-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; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/unbounded-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/unbounded-500-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; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/unbounded-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/unbounded-700-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 {
  /* палитра 60/30/10 — провенанс: ночная мастерская, свет индикатора */
  --bg: #14110D;          /* 60% тёплый почти-чёрный */
  --surface: #1E1913;     /* 30% тёплый уголь — панели, карточки */
  --surface-2: #272017;   /* поверхности второго уровня */
  --text: #F0EBE3;        /* тёплый почти-белый */
  --dim: #A99F90;         /* вторичный текст, 7.2:1 на фоне */
  --amber: #C99B5E;       /* 10% янтарь-индикатор, hsl(34 50% 58%), 7.47:1 на фоне */
  --cta-ink: #1A130A;     /* текст на янтарной заливке, 7.30:1 */
  --line: rgba(240, 235, 227, 0.10);
  --line-strong: rgba(240, 235, 227, 0.16);

  /* типографика: шкала ×1.333, база 17px */
  --font-display: 'Unbounded', 'Golos Text', sans-serif;
  --font-body: 'Golos Text', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
  --fs-body: 1.0625rem;    /* 17 */
  --fs-1: 1.4166rem;       /* 22.7 */
  --fs-2: 1.8889rem;       /* 30.2 */
  --fs-3: 2.5185rem;       /* 40.3 */
  --fs-mono: 0.8125rem;    /* 13 — служебные подписи */

  /* 8pt-сетка */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px; --s12: 96px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* одна кривая на сайт */
  --shadow-card: 0 1px 0 rgba(240, 235, 227, 0.05), 0 16px 32px -16px rgba(201, 155, 94, 0.10);
}

/* ---------- База ---------- */
/* MPA View Transitions: переход на /login (модалка-страница) без мигания */
@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; }
::selection { background: var(--amber); color: var(--cta-ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.container { max-width: 1360px; margin-inline: auto; padding-inline: var(--s3); }
@media (min-width: 768px) { .container { padding-inline: var(--s6); } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: var(--cta-ink);
  padding: var(--s1) var(--s2); font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }

/* моно-метки: единственный текстовый носитель янтаря */
.kicker {
  font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-mono);
  letter-spacing: 0.10em; text-transform: uppercase; color: var(--amber);
  margin-bottom: var(--s2);
}
.kicker-mark { color: var(--dim); margin-right: var(--s1); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px var(--s3);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  text-decoration: none; border: none; cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s var(--ease);
}
.btn-lg { min-height: 52px; padding: 12px var(--s4); }
.btn-primary {
  background: var(--amber); color: var(--cta-ink);
  box-shadow: 0 0 24px rgba(201, 155, 94, 0.22); /* единственное свечение — фокальный CTA */
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 32px rgba(201, 155, 94, 0.30); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--amber); }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* blur только там, где меню не fixed: backdrop-filter на предке
   делает его containing block для fixed-панели бургера */
@media (min-width: 1024px) {
  .site-header { background: rgba(20, 17, 13, 0.88); backdrop-filter: blur(12px); }
}
.header-row { display: flex; align-items: center; gap: var(--s3); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-dot { width: 8px; height: 8px; background: var(--amber); box-shadow: 0 0 8px rgba(201,155,94,.5); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; letter-spacing: 0.02em; }
.site-nav { margin-left: auto; }
.nav-list { display: flex; gap: var(--s3); }
.nav-list a {
  font-size: 0.9375rem; font-weight: 500; color: var(--dim); text-decoration: none;
  padding: var(--s1) 0; transition: color 0.18s var(--ease);
}
.nav-list a:hover { color: var(--text); }
.header-cta { display: none; }
.nav-cta { margin-left: var(--s3); }
.nav-close { display: none; }
.burger { display: none; }

@media (min-width: 1024px) {
  .site-nav { display: flex; align-items: center; }
}

@media (max-width: 1023px) {
  .header-cta { display: inline-flex; margin-left: auto; min-height: 40px; padding: 8px var(--s2); }
  .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 12px;
    background: transparent; border: 1px solid var(--line-strong); cursor: pointer;
  }
  .burger-line { display: block; width: 100%; height: 2px; background: var(--text); transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
  .burger[aria-expanded="true"] .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] .burger-line:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: fixed; inset: 0; z-index: 60;
    display: none;
    flex-direction: column; justify-content: center; align-items: flex-start;
    padding: var(--s8) var(--s4);
    background: var(--bg);
  }
  .site-nav.open { display: flex; }
  .nav-close {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: var(--s2); right: var(--s3);
    width: 44px; height: 44px;
    background: transparent; border: 1px solid var(--line-strong);
    color: var(--text); cursor: pointer;
  }
  .nav-list { flex-direction: column; gap: var(--s3); }
  .nav-list a { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-1); color: var(--text); }
  .nav-cta { margin: var(--s6) 0 0; }
}

/* ---------- Экран 1 · тип-герой ---------- */
.hero { position: relative; padding: var(--s8) 0 0; overflow: hidden; }
.hero-grid { display: grid; gap: var(--s6); }
.hero-copy { max-width: 640px; }
.hero h1 {
  font-size: clamp(1.9rem, 1.1rem + 4vw, 4.05rem);
  line-height: 1.06;
  margin-bottom: var(--s3);
}
.hero-sub {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-1);
  letter-spacing: -0.01em; line-height: 1.3; color: var(--text);
  margin-bottom: var(--s2);
}
.hero-lead { color: var(--dim); max-width: 54ch; margin-bottom: var(--s3); }
.hero-chips { display: flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s4); }
.hero-chips li {
  font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.04em;
  color: var(--dim); padding: 8px 12px; border: 1px solid var(--line);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* терминальная панель — живой виджет диалога */
.terminal {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  align-self: start;
}
.terminal-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--s2);
  border-bottom: 1px solid var(--line);
}
.terminal-ind { width: 8px; height: 8px; background: var(--amber); }
.terminal-title, .terminal-meta {
  font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500;
  letter-spacing: 0.10em; color: var(--amber);
}
.terminal-meta { margin-left: auto; color: var(--dim); white-space: nowrap; }
.terminal-title { white-space: nowrap; }
@media (max-width: 479px) { .terminal-meta { display: none; } }
.terminal-body { padding: var(--s3) var(--s2); display: grid; gap: var(--s2); min-height: 320px; align-content: start; }
.msg { max-width: 92%; font-size: 0.9375rem; line-height: 1.5; }
.msg-who {
  display: block; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.10em; color: var(--dim); margin-bottom: 4px;
}
.msg-farm { padding: 12px var(--s2); background: var(--surface-2); }
.msg-client { justify-self: end; text-align: left; padding: 12px var(--s2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.msg-sys { font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.04em; color: var(--amber); }
.terminal-caption {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--dim); padding: 12px var(--s2);
  border-top: 1px solid var(--line);
}

/* появление реплик: только при включённом JS и без reduce */
html.js .msg { opacity: 0; transform: translateY(10px); }
html.js .msg.shown { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }

/* нижняя моно-полоса героя */
.hero-foot {
  display: grid; grid-template-columns: 1fr; gap: 0;
  margin-top: var(--s8);
  border-top: 1px solid var(--line);
}
.foot-cell {
  font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.10em;
  color: var(--dim); padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) {
  .hero-foot { grid-template-columns: repeat(4, 1fr); }
  .foot-cell { border-bottom: none; padding: var(--s3) var(--s2); position: relative; }
  .foot-cell + .foot-cell::before {
    content: '+'; position: absolute; left: -5px; top: -9px;
    font-family: var(--font-mono); color: var(--dim); font-size: var(--fs-mono);
  }
  .foot-cell:first-child { padding-left: 0; }
}
@media (min-width: 1024px) {
  .hero { padding-top: var(--s12); }
  .hero-grid { grid-template-columns: 7fr 5fr; gap: var(--s8); align-items: center; }
}

/* ---------- Экран 2 · кадры работ ---------- */
.works { padding: var(--s12) 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
.works h2 { font-size: clamp(1.6rem, 1rem + 2.6vw, var(--fs-3)); line-height: 1.12; margin-bottom: var(--s2); }
.section-lead { color: var(--dim); max-width: 58ch; }

.rail-controls { display: none; gap: var(--s1); flex-shrink: 0; }
@media (min-width: 768px) { .rail-controls { display: flex; } }
.rail-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.rail-btn:hover { border-color: var(--amber); color: var(--amber); }
.rail-btn[disabled] { opacity: 0.35; cursor: default; }

.rail-wrap { overflow: hidden; }
.rail {
  display: flex; gap: var(--s3);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-inline: max(var(--s3), calc((100vw - 1360px) / 2 + var(--s6)));
  scroll-padding-inline: max(var(--s3), calc((100vw - 1360px) / 2 + var(--s6)));
  padding-bottom: var(--s2);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.case { flex: 0 0 min(85vw, 620px); scroll-snap-align: start; }

.case-frame {
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.frame-bar {
  display: flex; align-items: center; gap: var(--s2);
  padding: 12px var(--s2);
  border-bottom: 1px solid var(--line);
}
.frame-dots { display: inline-flex; gap: 6px; }
.frame-dots i { width: 8px; height: 8px; border: 1px solid var(--line-strong); }
.frame-url {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.10em; color: var(--dim);
}
.case-frame img {
  aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  width: 100%;
  filter: saturate(0.82) contrast(1.02); /* единая тёмная обработка серии */
}
.case-frame { position: relative; }
.case-frame::after { /* тёплая тональная вуаль — одна на всю серию */
  content: ''; position: absolute; inset: 41px 0 0;
  background: linear-gradient(180deg, rgba(20, 17, 13, 0.10), rgba(20, 17, 13, 0.24));
  pointer-events: none;
}
.case-caption {
  display: flex; align-items: baseline; gap: var(--s2);
  padding: var(--s2) 2px 0;
  color: var(--dim); font-size: 0.9375rem;
}
.case-idx {
  font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-mono);
  letter-spacing: 0.10em; color: var(--amber);
}

.rail-dots { display: flex; gap: var(--s1); margin-top: var(--s3); }
.rail-dot {
  width: 24px; height: 24px; padding: 8px;
  background: transparent; border: none; cursor: pointer;
}
.rail-dot i { display: block; width: 100%; height: 2px; background: var(--line-strong); transition: background-color 0.18s var(--ease); }
.rail-dot[aria-selected="true"] i { background: var(--amber); }

/* ---------- Замыкающая полоса ---------- */
.closer { border-top: 1px solid var(--line); padding: var(--s8) 0; }
.closer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.closer-line {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.2rem, 1rem + 1.4vw, var(--fs-2));
  line-height: 1.25; letter-spacing: -0.01em; max-width: 24ch; text-wrap: balance;
}

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--line); padding: var(--s3) 0; }
.footer-row {
  display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--dim);
}

/* ---------- Reveal секций (CSS scroll-driven, один момент) ---------- */
@supports (animation-timeline: view()) {
  html.js .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 24%;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { animation: none; }
  html.js .msg { opacity: 1; transform: none; transition: none; }
  .btn, .rail-btn, .nav-list a, .burger-line, .rail-dot i { transition: none; }
}
