/* ==========================================================================
   VIKNA.TECH — Reset + типографіка + креслярські утиліти
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: var(--lh-head);
  letter-spacing: var(--tr-head);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: var(--tr-tight); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tr-tight); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { text-wrap: pretty; }

/* Запобіжник від довгих слів на вузьких екранах: у технічних підписах
   дозволяємо перенос будь-де — вони формують мінімальну ширину блоків. */
.field__hint,
.opt__meta,
.opt__name,
.addon__meta,
.addon__name,
.summary__line,
.contact-item__value,
.card__text { overflow-wrap: anywhere; }

p, li, td, th, dd, figcaption { overflow-wrap: break-word; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

img, svg, video { display: block; max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

address { font-style: normal; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: var(--bw) solid var(--border); margin: 0; }

:focus-visible {
  outline: var(--bw-2) solid var(--c-accent);
  outline-offset: 2px;
}

::selection { background: var(--c-accent); color: #fff; }

/* ==========================================================================
   ФІШКА 1. Моноширинні числа й технічні підписи
   Кожна цифра на сайті — моно. Це те, що відрізняє інженерів від «продавців».
   ========================================================================== */

.mono,
.num,
.stat__value,
.card__price,
.summary__total-value,
.quick__price,
.calc-bar__value,
.promo-card__value,
.opt__price,
.addon__price,
.marquee__item,
input[type="number"],
input[type="tel"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tr-mono);
}

/* Технічний підпис: 01 / ПРОДУКЦІЯ */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--text-mute);
}

/* ==========================================================================
   ФІШКА 2. Креслярська сітка як фон секції
   ========================================================================== */

.blueprint {
  position: relative;
  isolation: isolate;
}
.blueprint::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) var(--bw), transparent var(--bw)),
    linear-gradient(90deg, var(--grid-line) var(--bw), transparent var(--bw));
  background-size: var(--grid-step) var(--grid-step);
  pointer-events: none;
}
.blueprint--fade::before {
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}

/* ==========================================================================
   ФІШКА 3. Кутові засічки — замість заокруглень і тіней
   ========================================================================== */

.ticks { position: relative; }
.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: var(--bw-2) solid var(--c-accent);
  opacity: 0;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  pointer-events: none;
  z-index: 2;
}
.ticks::before {
  top: -1px; left: -1px;
  border-right: 0; border-bottom: 0;
  transform: translate(4px, 4px);
}
.ticks::after {
  bottom: -1px; right: -1px;
  border-left: 0; border-top: 0;
  transform: translate(-4px, -4px);
}
.ticks:hover::before,
.ticks:hover::after,
.ticks.is-on::before,
.ticks.is-on::after {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   ФІШКА 4. Діагональне штрихування — акцентні площини без градієнтів
   ========================================================================== */

.hatch {
  background-image: repeating-linear-gradient(
    45deg,
    var(--c-line) 0 1px,
    transparent 1px 7px
  );
}
.hatch--accent {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 90, 31, 0.5) 0 1px,
    transparent 1px 7px
  );
}
.hatch--dark {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.12) 0 1px,
    transparent 1px 7px
  );
}

/* --- Загальні утиліти ----------------------------------------------------- */

.u-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.u-accent { color: var(--c-accent); }
.u-cool { color: var(--c-cool); }
.u-mute { color: var(--text-mute); }
.u-soft { color: var(--text-soft); }
.u-nowrap { white-space: nowrap; }
.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mt-4 { margin-top: var(--s-4); }
.u-mt-6 { margin-top: var(--s-6); }
.u-mt-8 { margin-top: var(--s-8); }
.u-mt-12 { margin-top: var(--s-12); }

/* Ховаємо, не чіпаючи власний display елемента.
   Раніше тут був display:none + revert — і .btn{display:inline-flex}
   з наступного файлу перебивав його, тож кнопки лізли в мобільний хедер. */
@media (max-width: 767px) { .u-hide-mobile { display: none !important; } }
@media (min-width: 768px) { .u-only-mobile { display: none !important; } }

/* Ключове слово в заголовку — підкреслене штриховою, як розмірна лінія */
.u-mark {
  position: relative;
  white-space: nowrap;
  color: var(--c-accent);
}
.u-mark::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.06em;
  height: 2px;
  background: repeating-linear-gradient(90deg, currentColor 0 8px, transparent 8px 14px);
}

/* Поява при скролі — вмикається класом .is-in з app.js */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.06s; }
.reveal[data-delay="2"] { transition-delay: 0.12s; }
.reveal[data-delay="3"] { transition-delay: 0.18s; }
.reveal[data-delay="4"] { transition-delay: 0.24s; }
.reveal[data-delay="5"] { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --- Друк ------------------------------------------------------------------ */

@media print {
  .header, .topbar, .drawer, .footer, .mobile-bar, .calc-bar,
  .modal, .summary__actions, .calc__hint { display: none !important; }
  body { background: #fff; }
  .section { padding-block: 0; }
}
