:root {
  --bg: #05060a;
  --ink: #eef1f8;
  --mute: #9aa2b6;
  --blue: #4d7cff;
  --blue-hi: #8fabff;
  --line: rgba(255, 255, 255, .14);
  --pad: clamp(20px, 3.4vw, 60px);
  --bar: 0px;   /* výška cookies lišty, ktorú treba odpočítať (iba mobil) */
  --u: calc((100dvh - var(--bar)) / 100);
  --font: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- pozadie: pole štvorčekov ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  opacity: 0;
  animation: fade 1.6s ease .1s forwards;
}

/* zosvetlenie pod textom, aby bol vždy čitateľný */
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(5, 6, 10, .86) 28%, rgba(5, 6, 10, 0) 62%),
    linear-gradient(0deg, rgba(5, 6, 10, .9) 0%, rgba(5, 6, 10, 0) 34%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

/* bez JavaScriptu: statická mriežka štvorčekov */
html:not(.js) body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, var(--bg) 74%, transparent 74%) 0 0 / 28px 28px,
    linear-gradient(0deg, var(--bg) 74%, transparent 74%) 0 0 / 28px 28px,
    #27408f;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 70% 45%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 70% 45%, #000 0%, transparent 75%);
  opacity: .8;
}

/* ---------- rozloženie ---------- */

.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: calc(100dvh - var(--bar));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
}

.logo {
  display: block;
  width: clamp(132px, 10.5vw, 200px);
  height: auto;
}

main {
  align-self: end;
  padding-bottom: clamp(20px, 4.2vh, 56px);
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0;
  max-width: 6.6em;
  font-weight: 650;
  font-size: clamp(2.2rem, min(11.5vw, calc(var(--u) * 8.5)), 7rem);
  line-height: .96;
  letter-spacing: -.045em;
}

.ln { display: block; }
.ln-2 { margin-top: .1em; }

/* bodka za „fungujú“ je štvorček z loga */
.dot {
  display: inline-block;
  width: .16em;
  height: .16em;
  margin-left: .06em;
  background: var(--blue);
  box-shadow: 0 0 .5em rgba(77, 124, 255, .75), 0 0 1.6em rgba(77, 124, 255, .35);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.services {
  list-style: none;
  margin: clamp(16px, 3.2vh, 36px) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35em 1.6em;
  font-size: clamp(.95rem, 1.35vw + .35rem, 1.45rem);
  letter-spacing: -.005em;
  color: var(--mute);
}

.services li::before {
  content: "";
  display: inline-block;
  width: .3em;
  height: .3em;
  margin-right: .6em;
  vertical-align: .12em;
  background: var(--blue);
}

footer {
  max-width: 44rem;
  padding-top: clamp(14px, 2.4vh, 26px);
  border-top: 1px solid var(--line);
}

address {
  font-style: normal;
  display: flex;
  flex-wrap: wrap;
  gap: .4em 2.4em;
  font-size: clamp(1rem, 1.1vw + .55rem, 1.4rem);
  font-variant-numeric: tabular-nums;
}

address a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  padding: .2em 0;
}

address a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--blue);
  transform: scaleX(.18);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2, .7, .1, 1), background-color .2s;
}

address a:hover,
address a:focus-visible { color: #fff; }

address a:hover::after,
address a:focus-visible::after {
  transform: scaleX(1);
  background: var(--blue-hi);
}

address a:focus-visible {
  outline: 2px solid var(--blue-hi);
  outline-offset: 6px;
  border-radius: 2px;
}

/* ---------- širšie obrazovky: text vľavo, objekt vpravo ---------- */

@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  /* desktop: každá veta na vlastnom riadku, nadpis smie zasahovať do grafiky */
  h1 {
    max-width: none;
    font-size: clamp(3.2rem, min(9.6vw, calc(var(--u) * 19)), 11.5rem);
  }
  .ln { white-space: nowrap; }
  .veil {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgba(5, 6, 10, .8) 30%, rgba(5, 6, 10, 0) 58%),
      linear-gradient(0deg, rgba(5, 6, 10, .7) 0%, rgba(5, 6, 10, 0) 26%),
      radial-gradient(120% 90% at 62% 45%, transparent 55%, rgba(0, 0, 0, .6) 100%);
  }
}

/* portrét a mobil: objekt vyššie v pozadí, text dole */
@media (max-aspect-ratio: 5/4) {
  .veil {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(5, 6, 10, .9) 30%, rgba(5, 6, 10, 0) 62%),
      radial-gradient(120% 80% at 50% 30%, transparent 55%, rgba(0, 0, 0, .55) 100%);
  }
  footer { max-width: none; }
}

@media (max-width: 420px) {
  .services { gap: .25em 1.2em; }
  address { gap: .2em 1.6em; }
}

/* ---------- reveal po načítaní (funguje aj bez JS) ---------- */

@keyframes fade { to { opacity: 1; } }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .rv {
    opacity: 0;
    animation: rise 1s cubic-bezier(.2, .7, .1, 1) var(--d, 0s) forwards;
  }
  .dot { animation: pulse 3.6s ease-in-out 2s infinite; }
}

@keyframes pulse {
  50% { box-shadow: 0 0 .3em rgba(77, 124, 255, .5), 0 0 1em rgba(77, 124, 255, .2); }
}

@media (prefers-reduced-motion: reduce) {
  #field { animation: none; opacity: 1; }
  address a::after { transition: none; }
}

/* ---------- súhlas s cookies ---------- */

.cookies-btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin: -.4em -.6em 0 0;
  padding: .4em .6em;
  background: none;
  border: 0;
  font: inherit;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
  opacity: .8;
  cursor: pointer;
  transition: color .2s, opacity .2s;
}

.cookies-btn::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--blue);
}

.cookies-btn:hover { color: var(--ink); opacity: 1; }
.cookies-btn[hidden], .consent[hidden], .consent-info[hidden] { display: none; }

.consent {
  position: fixed;
  z-index: 10;
  right: var(--pad);
  bottom: var(--pad);
  width: min(22.5rem, calc(100vw - 2 * var(--pad)));
  max-height: calc(100dvh - 2 * var(--pad));
  overflow: auto;
  padding: 16px 18px 18px;
  background: #0d1017;
  border: 1px solid rgba(255, 255, 255, .16);
  border-top: 2px solid var(--blue);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink);
}

.consent p { margin: 0; }
.consent-text { color: #d5daea; }

.consent-info {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: .82rem;
}

.consent-info p + p { margin-top: .6em; }
.consent-info code { font-size: .92em; color: #c4cce2; }

.consent-more {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: var(--blue-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.consent-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.consent-btn {
  flex: 1 1 0;
  min-height: 44px;
  padding: .55em 1em;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .42);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}

.consent-btn:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--blue-hi);
}

.consent button:focus-visible,
.cookies-btn:focus-visible {
  outline: 2px solid var(--blue-hi);
  outline-offset: 3px;
}

/* mobil a portrét: lišta cez celú šírku, obrazovka sa o ňu skráti */
@media (max-aspect-ratio: 5/4), (max-width: 700px) {
  :root { --bar: var(--bar-h, 0px); }
  body { padding-bottom: var(--bar); }

  .consent {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: 70dvh;
    padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom, 0px));
    border-width: 2px 0 0;
    border-top-color: var(--blue);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
  }

  .consent-actions { margin-top: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .consent:not([hidden]) { animation: rise .5s cubic-bezier(.2, .7, .1, 1) both; }
}

@media (prefers-reduced-motion: reduce) {
  .consent-btn, .cookies-btn { transition: none; }
}
