/* Фасад сайта Formforge: общий каркас (шапка, подвал, главная, информационные страницы).
   Тёмная тема dark tech. Шрифты свои, из /site/fonts: никаких запросов на сторонние серверы.
   Токены переопределяют палитру calc.css, поэтому калькулятор и форма заказа выглядят так же. */

/* ---------- шрифты ---------- */
@font-face { font-family: 'Exo 2'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/exo-2-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Exo 2'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/exo-2-latin-400-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: 'Exo 2'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/exo-2-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: 'Exo 2'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/exo-2-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: 'Exo 2'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/exo-2-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Exo 2'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/exo-2-latin-600-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: 'Exo 2'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/exo-2-cyrillic-800-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Exo 2'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/exo-2-latin-800-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-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/jetbrains-mono-latin-400-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: 500; font-style: normal; font-display: swap; src: url('fonts/jetbrains-mono-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: 'JetBrains Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/jetbrains-mono-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; }

/* ---------- токены (общие для сайта, калькулятора и формы) ---------- */
:root {
  --bg: #07080D;
  --sheet: #0D1019;
  --stage: #090C14;
  --ink: #E6EAF2;
  --muted: #98A3B8;
  --line: #1B2433;
  --line-strong: #3A4A66;
  --accent: #00E5FF;
  --dir: var(--accent); /* цвет направления = основной цвет текущей темы */
  --accent-ink: #07080D;
  --accent-hover: #7FF3FF;
  --magenta: #FF2BD6; /* второй цвет темы (подсветка слов, подписи, второй цвет каркасов) */
  --glow: 0, 229, 255; /* rgb основного цвета: сетка фона, свечение кнопок */
  --shade: 7, 8, 13; /* rgb фона: шапка, подвал, затемнение первого экрана */
  --hero-from: #0D1019;
  --hero-to: #141B2B;
  --model: #9FB3C8;
  --grid: #172033;
  --grid-c: #2C3E5C;
  --mid: #E0A53A;
  --hard: #FF6B8A;
  --display: 'Exo 2', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --body: 'Exo 2', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* ---------- темы направлений ----------
   Тема целиком (фон, основной и второй цвет, шапка, логотип, кнопки) задаётся атрибутом data-theme на <html>.
   Код темы = код направления. Печать это базовые токены выше; новому направлению нужна своя строка здесь. */
:root[data-theme="inzheneriya"] {
  --bg: #060D1A; --sheet: #0B1628; --stage: #08111F;
  --ink: #E4ECF7; --muted: #8FA3BF;
  --line: #16273F; --line-strong: #34527A;
  --accent: #4DA3FF; --accent-ink: #04101F; --accent-hover: #8CC4FF;
  --magenta: #FFC247;
  --glow: 77, 163, 255; --shade: 6, 13, 26;
  --hero-from: #0B1628; --hero-to: #060D1A;
}
/* Металл: черновик палитры, пока направление выключено; цвет решим глазами на готовых страницах */
:root[data-theme="metall"] {
  --bg: #0C0906; --sheet: #15100B; --stage: #0F0B08;
  --ink: #F0E9E2; --muted: #A99A8C;
  --line: #2A2018; --line-strong: #5E4631;
  --accent: #FF7A1A; --accent-ink: #0C0906; --accent-hover: #FFA061;
  --magenta: #E6EAF2;
  --glow: 255, 122, 26; --shade: 12, 9, 6;
  --hero-from: #15100B; --hero-to: #0C0906;
}

body.site {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(var(--glow), 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--glow), 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
body.site a { color: inherit; }
body.site a:hover { color: var(--accent); }
body.site :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; font-weight: 600; }
.skip:focus { left: 8px; }

.site-w { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); box-sizing: border-box; }
@media (min-width: 900px) { .site-w { padding-inline: 48px; } }

/* ---------- шапка ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgba(var(--shade), 0.88); position: relative; z-index: 5; }
.site-header .site-w { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 28px; padding-block: 14px; }
.site-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 24px; letter-spacing: 0.04em; text-transform: uppercase; min-height: 44px; }
.site-logo b { color: var(--accent); font-weight: 800; }
.site-logo svg { flex: none; color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.site-nav a { text-decoration: none; padding: 12px 0; min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
.site-nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 599px) { .site-tag { display: none; } }
.site-tag { flex-basis: 100%; margin: 0; padding-bottom: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 1100px) { .site-tag { flex-basis: auto; padding: 0; order: 2; margin-left: auto; } .site-header .site-w { flex-wrap: nowrap; } .site-nav { order: 1; } }

/* ---------- кнопки ---------- */
.cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; box-sizing: border-box;
  padding: 14px 28px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink) !important; font: 800 15px/1.2 var(--display);
  text-transform: uppercase; letter-spacing: 0.04em;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  filter: drop-shadow(0 0 14px rgba(var(--glow), 0.35));
}
.cta:hover { background: var(--accent-hover); }
.cta.ghost { background: transparent; color: var(--ink) !important; border: 1px solid var(--line-strong); clip-path: none; filter: none; font-weight: 600; }
.cta.ghost:hover { border-color: var(--accent); color: var(--accent) !important; background: transparent; }
.link-mono { font-family: var(--mono); font-size: 13px; text-decoration: none; padding: 12px 0; display: inline-block; }

/* глитч: короткие и редкие, чтобы не раздражать; на наведение кнопки отдельный быстрый */
@keyframes ff-glitch { 0%, 92%, 100% { transform: none; text-shadow: none; } 93% { transform: translate(-2px, 0); text-shadow: 2px 0 var(--magenta), -2px 0 var(--bg); } 95% { transform: translate(2px, 1px); text-shadow: -2px 0 var(--magenta), 2px 0 var(--bg); } 97% { transform: translate(-1px, -1px); text-shadow: 1px 0 var(--magenta); } }
@keyframes ff-glitch-hover { 0% { transform: none; } 20% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--magenta), -2px 0 var(--bg); } 40% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--magenta), 2px 0 var(--bg); } 60% { transform: translate(-1px, 0); } 100% { transform: none; text-shadow: none; } }
@keyframes ff-scroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.cta.glitch { animation: ff-glitch 7s infinite; }
.cta.glitch:hover { animation: ff-glitch-hover .35s linear 1; }
.glitch-text { display: inline-block; color: var(--magenta); animation: ff-glitch 9s infinite; }

/* ---------- главная: первый экран ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-panel { width: 100%; }
.hero-panel[hidden] { display: none; }
.hero-bg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%); }
.hero-bg video, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--shade), 0.96) 0%, rgba(var(--shade), 0.84) 50%, rgba(var(--shade), 0.4) 100%); }
.hero-gcode, .hero-wire { display: none; }
.hero-in { position: relative; z-index: 1; padding-block: 56px 64px; display: flex; flex-direction: column; gap: 24px; max-width: 700px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--dir); text-transform: uppercase; margin: 0; }
.hero-title { margin: 0; font-weight: 800; font-size: clamp(34px, 6vw, 58px); line-height: 1.07; letter-spacing: -0.01em; text-transform: none; text-wrap: balance; display: block; }
.hero .lead { margin: 0; font-size: 19px; line-height: 1.6; max-width: 540px; color: #B4BCCB; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.hero-note { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--magenta); }
@media (min-width: 900px) {
  .hero { min-height: 620px; display: flex; align-items: center; }
  .hero-in { padding-block: 96px 104px; }
  .hero-gcode, .hero-wire {
    display: block; position: absolute; top: 0; bottom: 0; right: max(48px, calc((100vw - 1280px) / 2 + 48px)); width: 300px; overflow: hidden; opacity: 0.55; z-index: 1;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  }
  .hero-wire { opacity: 0.95; }
  .hero-wire canvas { display: block; width: 100%; height: 100%; }
  .hero-gcode div { font-family: var(--mono); font-size: 12px; line-height: 1.9; color: var(--accent); animation: ff-scroll 40s linear infinite; }
  .hero-gcode span { display: block; white-space: pre; }
}

/* переключатель направлений на первом экране: вкладки, не карусель */
.hero-tabs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-tabs a { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 0 14px; text-decoration: none; color: var(--muted); border: 1px solid var(--line-strong); background: rgba(var(--shade), 0.55); }
.hero-tabs a:hover { color: var(--dir); border-color: var(--dir); }
.hero-tabs a[aria-current] { color: var(--dir); border-color: var(--dir); box-shadow: inset 0 -3px 0 var(--dir); }

/* --dir = основной цвет текущей темы: карточки услуг и заголовки внутри страниц направлений */
.card[data-dir] { border-top: 3px solid var(--dir); }
.card[data-dir]:hover { border-color: var(--dir); }
[data-dir] .prose h2 { border-left: 3px solid var(--dir); padding-left: 12px; }

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

/* ---------- секции ---------- */
.sec { padding-block: 64px; border-top: 1px solid var(--line); }
.sec.alt { background: rgba(13, 16, 25, 0.8); }
.sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 28px; }
.sec-title .n { font-family: var(--mono); font-size: 13px; color: var(--magenta); font-weight: 400; }
.sec-title h2 { margin: 0; font-weight: 800; font-size: clamp(26px, 4vw, 34px); text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15; }
.sec-title a { margin-left: auto; }
.cards[hidden] { display: none; } /* без этого display:grid перебивает атрибут hidden */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--sheet); border: 1px solid #243049; padding: 26px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 21px; color: var(--accent); line-height: 1.25; }
.card p { margin: 0; font-size: 15px; line-height: 1.6; color: #B4BCCB; }
.card .more { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.work { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.work .ph { aspect-ratio: 1 / 1; background: var(--sheet); border: 1px solid #243049; display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: center; padding: 12px; }
.work img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid #243049; display: block; }
.work figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 16px; }
.steps .no { font-family: var(--mono); font-size: 34px; line-height: 1; color: var(--accent); }
.steps h3 { margin: 0 0 6px; font-size: 19px; }
.steps p { margin: 0; font-size: 15px; line-height: 1.6; color: #B4BCCB; }
.band { padding-block: 72px; border-top: 1px solid var(--line); }
.band .site-w { display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between; align-items: flex-end; }
.band h2 { margin: 0; flex: 1 1 340px; font-weight: 800; font-size: clamp(28px, 4.4vw, 40px); line-height: 1.12; text-transform: uppercase; }
.band h2 span { color: var(--magenta); }
.contacts-list { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 16px; }
.contacts-list a { text-decoration: none; padding: 6px 0; }

/* ---------- информационные страницы ---------- */
.page-head { padding-block: 48px 8px; }
.page-head .eyebrow { margin-bottom: 10px; }
.page-head h1 { margin: 0; font-weight: 800; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; text-transform: none; letter-spacing: -0.01em; text-wrap: balance; display: block; }
.page-head .lead { margin: 16px 0 0; font-size: 19px; line-height: 1.6; color: #B4BCCB; max-width: 66ch; }
.prose { padding-block: 24px 64px; max-width: 74ch; }
.prose h2 { font-size: 24px; font-weight: 800; margin: 40px 0 12px; line-height: 1.2; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; color: var(--accent); }
.prose p, .prose li { color: #CBD2DF; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); }
.prose .todo { border: 1px dashed var(--magenta); padding: 10px 14px; color: var(--magenta); font-family: var(--mono); font-size: 13px; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 18px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border: 1px solid var(--line-strong); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 400; background: var(--sheet); }
.prose-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.faq details { border: 1px solid var(--line-strong); background: var(--sheet); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; min-height: 44px; box-sizing: border-box; list-style-position: inside; }
.faq details[open] summary { color: var(--accent); }
.faq details > div { padding: 0 18px 14px; color: #CBD2DF; }
.faq details > div p { margin: 0 0 10px; }

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px 28px; font-size: 13px; color: var(--muted); background: rgba(var(--shade), 0.9); }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px 32px; margin-bottom: 24px; }
.site-footer h2 { margin: 0 0 8px; font: 400 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-block; padding: 7px 0; text-decoration: none; color: var(--ink); }
.site-footer .legal { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-family: var(--mono); font-size: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.site-footer .legal a { padding: 6px 0; display: inline-block; }

/* ---------- обёртка страниц калькулятора и формы ---------- */
body.site .wrap { max-width: 1280px; padding-block: 28px 56px; }
@media (min-width: 900px) { body.site .wrap { padding-left: 48px; padding-right: 48px; } }
body.site .wrap.narrow > * { max-width: 760px; }

/* ---------- уведомление о cookie ---------- */
.cookie { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 760px; margin-inline: auto; background: var(--sheet); border: 1px solid var(--accent); box-shadow: 0 0 24px rgba(var(--glow), 0.2); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 14px; }
.cookie[hidden] { display: none; }
.cookie p { margin: 0; flex: 1 1 320px; color: #CBD2DF; }
.cookie a { color: var(--accent); }
.cookie button { min-height: 44px; padding: 10px 22px; border: 0; background: var(--accent); color: var(--accent-ink); font: 800 14px var(--display); text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }

/* ---------- заглушки и движение ---------- */
@media (prefers-reduced-motion: reduce) {
  .cta.glitch, .glitch-text, .hero-gcode div { animation: none !important; }
}

/* Документы: оферта, доставка, возврат, бланк заявления (30.10.2026) */
.doc-links { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.btn-print { font: inherit; color: var(--accent); background: none; border: 1px solid var(--line-strong); padding: 4px 10px; cursor: pointer; }
.blank { border: 1px dashed var(--line-strong); padding: 16px 18px; }
@media (max-width: 640px) { .prose table { display: block; overflow-x: auto; } }
@media print {
    .site-header, .site-footer, .cookie, .skip, .doc-links, .page-head .lead { display: none !important; }
    body.site, .prose p, .prose li, .prose td, .prose th { background: #fff !important; color: #000 !important; }
    .blank { border: none; padding: 0; }
}
