/* ==========================================================================
   IVAS — reset, base elements, utilities
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Author `display` declarations outrank the UA's [hidden] rule, so anything
   given display by a class (.btn, .section-head, .product-grid…) stays visible
   even when hidden is set. Everything toggled from JS relies on this. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* the fixed bottom UI must never cover an anchor target */
  scroll-padding-block-start: 88px;
  scroll-padding-block-end: calc(var(--bottom-ui-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* The footer's last row now reserves --bottom-ui-h itself (§3.4), so a body
     padding on top of that would just be dead space under the dock. */
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -.025em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); letter-spacing: -.03em; font-weight: 550; }
h2 { font-size: var(--fs-h2); font-weight: 550; }
h3 { font-size: var(--fs-h3); letter-spacing: -.01em; }

p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a:not([class]) {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}
a:not([class]):hover { text-decoration-thickness: 2px; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

::selection { background: var(--accent); color: var(--accent-fg); }

/* --- focus ---------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Every dark surface the site actually uses. `.on-dark` was the only selector
   here, and nothing carries that class — so the navy ring was being drawn on
   navy in the hero, the banners, the dark sections, the menu, the dock, the
   search overlay and the assistant: invisible everywhere it mattered most. */
.on-dark :focus-visible,
.hero__card :focus-visible,
.banner__card :focus-visible,
.section--dark :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible,
.mobile-menu :focus-visible,
.header-pill :focus-visible,
.header-bar :focus-visible,
.bottom-row :focus-visible,
.search-overlay :focus-visible,
.assistant :focus-visible,
.demit-swatch :focus-visible,
.cat-tile:focus-visible,
[data-theme='dark'] :focus-visible {
  outline-color: var(--accent-on-chrome);
  outline-offset: 3px;
}

/* disabled: one look for every control type (§8 states) */
:disabled, [aria-disabled='true'] {
  opacity: .45; cursor: not-allowed; pointer-events: none;
}
/* loading: used by the catalogue and the assistant while they render */
[aria-busy='true'] { cursor: progress; }
[aria-busy='true'] > * { opacity: .55; transition: opacity var(--dur) var(--ease-out); }

/* --- mono data ------------------------------------------------------------ */
.mono {
  font-family: var(--font-mono);
  font-size: .82em;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }

/* --- utilities ------------------------------------------------------------ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 200;
  transform: translateY(-160%);
  background: var(--chrome); color: var(--on-dark);
  padding: .7rem 1.1rem; border-radius: var(--r-input);
  font-size: var(--fs-small); font-weight: 600;
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

.lead {
  font-size: clamp(1.05rem, .6vw + .95rem, 1.3rem);
  line-height: 1.5;
  color: var(--ink-muted);
}
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }

/* concrete grain — light surfaces only */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: .03; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* lattice pattern for dark sections */
.lattice-bg { position: relative; isolation: isolate; }
.lattice-bg::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='68' viewBox='0 0 120 68'%3E%3Cg fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M60 2 118 34 60 66 2 34Z'/%3E%3Cpath d='M31 18 89 50M89 18 31 50'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 68px;
}

/* --- print ---------------------------------------------------------------- */
@media print {
  .site-header, .bottom-row, .site-footer, .cta-band, .preloader,
  .transition-layer, .assistant, .search-overlay, .mobile-menu,
  .banner, .hero, .dock, .to-top, .fab-ai, .mega, .toast, .skip-link { display: none !important; }
  /* the photo banner is replaced on paper by one line saying whose page it is */
  main::before {
    content: "IVAS d.o.o., Ovčanski put 63, 11211 Borča, tel. 011 298 0234, ivas11@yahoo.com";
    display: block; padding: 0 0 8pt; margin-bottom: 12pt; border-bottom: 1pt solid #999;
    font-size: 9pt; color: #333;
  }
  body { padding: 0; background: #fff; color: #000; }
  a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: .8em; }
}
