/* Vors.studio — site layer over Triangulum tokens.
   Variant A "Stanovisko" (editorial, centred, calm) is the base.
   Variant B "Triangulácia" (instrument, coordinate rail, dense) overrides via
   html[data-variant="b"]. Density + reveal are environment switches. */

:root {
  --sec-pad: clamp(60px, 8vw, 140px);   /* regular density (default) */
  --rule-w: 30px;
}
html[data-density="compact"] { --sec-pad: clamp(44px, 5vw, 92px); }
html[data-density="comfy"]   { --sec-pad: clamp(84px, 10vw, 188px); }

/* ── Background stack ─────────────────────────────────────────── */
/* Night: strengthen the warm amber discharge in the bottom-right corner so it
   reads with real presence (the DS night stack ships it at only .07). Cool
   top-centre + linear base are kept; day is untouched (it has its own rgba). */
html:not([data-theme="day"]) body {
  background-image:
    radial-gradient(ellipse 60% 50% at 50% -12%, rgba(210, 212, 208, 0.05), transparent 70%),
    radial-gradient(ellipse 62% 58% at 78% 96%, rgba(194, 119, 46, 0.17), transparent 72%),
    linear-gradient(178deg, #0B0C0D 0%, #090A0B 55%, #060708 100%);
}

/* Safety net against horizontal panning on touch devices: anything that leaks
   past the viewport is clipped instead of widening the page. `clip` (unlike
   `hidden`) creates no scroll container, so the sticky header keeps working. */
html, body { overflow-x: clip; }

/* Kill the double-tap-to-zoom gesture (and its 300ms tap delay). Pinch-zoom is
   blocked in assets/analytics.js — Safari won't honour it via CSS/meta. */
html { touch-action: manipulation; }

body::before, body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
body::before {
  background: url("assets/triangulation-net.svg") center / cover no-repeat;
  opacity: .12;
}
/* Night swaps the net to a light-stroke variant so the background diagram
   reads with the same subtle detail it has on day's concrete. */
html:not([data-theme="day"]) body::before {
  background-image: url("assets/triangulation-net-night.svg");
  opacity: .14;
}
html:not([data-theme="day"]) .net-layer {
  background-image: url("assets/triangulation-net-night.svg") !important;
}
body::after {
  background: url("assets/grain.svg"); opacity: .045; mix-blend-mode: overlay;
}
html[data-theme="day"] body::after { mix-blend-mode: multiply; opacity: .06; }
#app { position: relative; z-index: 1; }

/* ── Section scaffold ─────────────────────────────────────────── */
.sec { padding: var(--sec-pad) var(--gutter); border-top: 1px solid var(--line); }
.sec-inner { max-width: var(--maxw); margin: 0 auto; }
.sec--top { border-top: 0; }

/* ── Reveal-on-scroll ─────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease-out, cubic-bezier(.2,.7,.2,1)),
              transform .7s var(--ease-out, cubic-bezier(.2,.7,.2,1));
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }
html[data-reveal="off"] .reveal { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── Coordinate rail (variant B) ──────────────────────────────── */
.coordrail {
  display: none; position: fixed; left: clamp(14px, 2.4vw, 30px); top: 50%;
  transform: translateY(-50%); z-index: 30;
  flex-direction: column; gap: 14px; pointer-events: auto;
}
html[data-variant="b"] .coordrail { display: flex; }
.coordrail a {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em;
  text-transform: uppercase; text-decoration: none; color: var(--titanium-mute);
  display: flex; align-items: center; gap: 9px;
  transition: color var(--t-quick,.3s) var(--ease-out);
}
.coordrail a::before {
  content: ''; width: 16px; height: 1px; background: var(--line);
  transition: background var(--t-quick,.3s) var(--ease-out), width var(--t-quick,.3s) var(--ease-out);
}
.coordrail a:hover, .coordrail a[data-cur="1"] { color: var(--titanium); }
.coordrail a:hover::before, .coordrail a[data-cur="1"]::before {
  background: var(--signal); width: 26px;
}
@media (max-width: 1320px) { html[data-variant="b"] .coordrail { display: none; } }

/* ── Sightline: hairline that draws under a row on hover (variant B) ── */
.sline { position: relative; }
.sline::after {
  content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: linear-gradient(90deg, var(--signal), transparent);
  transition: width .5s var(--ease-draw, cubic-bezier(.16,.8,.3,1));
}
html[data-variant="b"] .sline:hover::after { width: 100%; }

/* ── Editorial centring (variant A) for select blocks ─────────── */
.v-center-a { text-align: left; }
html[data-variant="a"] .v-center-a { text-align: center; }

/* ── Hairline grid wrapper ────────────────────────────────────── */
.hgrid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.hgrid > * { background: var(--char); }

/* ── Sigil: restore the day hierarchy in NIGHT, glare-tamed ───── */
/* Day reads as: amber fix → clear thin structure (baseline/sightlines/stations)
   → faint construction arcs. Night must keep that SAME order — earlier I
   inverted it (arcs popped, structure vanished). So: tone the bright titanium
   structure down to titanium-dim (kills the glare of light strokes on black,
   stays clearly visible because the lines are thin), and lift only the faint
   construction arcs a little — they stay the most recessive layer. The amber
   fix is never touched. Day is untouched. */
html:not([data-theme="day"]) svg[role="img"] > line {
  stroke: var(--titanium-dim) !important;
}
html:not([data-theme="day"]) svg[role="img"] > g:not([opacity]) circle {
  stroke: var(--titanium-dim) !important;
}
html:not([data-theme="day"]) svg[role="img"] g[opacity] {
  opacity: .3 !important;
}

/* ── Generic helpers ──────────────────────────────────────────── */
.mono-meta {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--titanium-mute);
}
.lede {
  font-family: var(--font-body); font-weight: 400; font-size: var(--type-led);
  line-height: var(--lh-lede); color: var(--titanium-dim);
}
.disp {
  font-family: var(--font-display); font-weight: 300; letter-spacing: -.015em;
  color: var(--titanium);
}
.ital-signal { font-style: italic; color: var(--signal); }

/* ── Triangulation diagram — the located-point glow (only infinite anim) ── */
@keyframes vors-fix-glow {
  0%, 100% { opacity: .14; transform: scale(.85); }
  50%      { opacity: .40; transform: scale(1.30); }
}
.vors-fix-glow {
  transform-box: fill-box; transform-origin: center;
  animation: vors-fix-glow 5.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .vors-fix-glow { animation: none; opacity: .24; }
}

a.qlink {
  color: var(--titanium-dim); text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color var(--t-quick,.3s) var(--ease-out), border-color var(--t-quick,.3s) var(--ease-out);
}
a.qlink:hover { color: var(--titanium); border-color: var(--signal); }

/* ── Responsive collapses ─────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .hero-grid, .split { grid-template-columns: 1fr !important; }
  .hero-grid .hero-figure { order: -1; }
}

/* ── Row with a long definition as value (home: scope + translation) ── */
/* The DS Row keeps value on one nowrap line — right on wide screens, but the
   ~850px line overflows below ~1240px. Let it wrap there; on phones drop it
   under the label (the value span is the row's last child). */
@media (max-width: 1240px) {
  .row-def > div > span:last-child { white-space: normal !important; max-width: 46ch; }
}
@media (max-width: 700px) {
  .row-def > div { grid-template-columns: auto minmax(0, 1fr) !important; }
  .row-def > div > span:last-child {
    grid-column: 2; max-width: none; text-align: left !important; margin-top: 2px;
  }
}

/* Static privacy pages (sukromie / en/privacy) carry a hand-authored header;
   its inline flex nav cannot wrap and pushed the page ~200px past the viewport
   on phones. Let the header grow and the links wrap. */
@media (max-width: 700px) {
  .pnav-header { height: auto !important; min-height: 68px; padding: 14px 24px !important; flex-wrap: wrap; }
  .pnav { flex-wrap: wrap; gap: 10px 18px !important; justify-content: flex-end; }
}

/* ── Mobile nav ───────────────────────────────────────────────── */
@media (max-width: 760px) {
  .nav-desktop { display: none !important; }
  .nav-mobile { display: flex !important; }
  /* The header wordmark reads too small next to the burger cluster on phones. */
  .nav-wm { transform: scale(1.18); transform-origin: left center; }
}
.mobnav {
  position: fixed; inset: 0; top: 68px; z-index: 60;
  /* Opaque: the body is scroll-locked (position:fixed) behind the overlay, and a
     translucent panel let the frozen page text bleed through in night theme. The
     .mobnav-net layer still supplies the frosted texture. */
  background: var(--void);
  display: flex; flex-direction: column;
  /* The body is scroll-locked while open (position:fixed), so a tall menu must
     scroll within the overlay itself; contain stops the scroll from chaining. */
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  animation: mobnav-in .32s var(--ease-out, cubic-bezier(.2,.7,.2,1));
}
@keyframes mobnav-in { from { opacity: 0; } to { opacity: 1; } }
.mobnav-net {
  position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background: url("assets/triangulation-net-night.svg") center / cover no-repeat;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%);
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%);
}
html[data-theme="day"] .mobnav-net { background-image: url("assets/triangulation-net.svg"); }
.mobnav-list {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(24px, 7vw, 48px) var(--gutter);
}
.mobnav-link {
  display: flex; align-items: baseline; gap: 18px;
  text-decoration: none; padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.mobnav-link:first-child { border-top: 1px solid var(--line); }
.mobnav-coord {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .26em;
  color: var(--titanium-mute); min-width: 26px;
}
.mobnav-link[data-cur="1"] .mobnav-coord { color: var(--signal); }
.mobnav-label {
  font-family: var(--font-display); font-weight: 300; letter-spacing: -.015em;
  font-size: clamp(1.9rem, 9vw, 2.8rem); line-height: 1;
  color: var(--titanium-dim); transition: color var(--t-quick,.3s) var(--ease-out);
}
.mobnav-link[data-cur="1"] .mobnav-label { color: var(--titanium); }
.mobnav-link:active .mobnav-label, .mobnav-link:hover .mobnav-label { color: var(--titanium); }
.mobnav-cta { margin-top: clamp(28px, 7vw, 44px); }
@media (prefers-reduced-motion: reduce) { .mobnav { animation: none; } }

/* ── Consent banner ───────────────────────────────────────────── */
/* Fixed bottom bar. Void plane under blur, one hairline, mono actions.
   Accept carries the single amber signal; Decline is an equal-size ghost
   button (same padding, same row) so the choice is genuinely balanced. */
.vors-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px 28px; padding: 16px var(--gutter, 32px);
  background: color-mix(in srgb, var(--void) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  animation: vors-consent-in .45s var(--ease-out, cubic-bezier(.2,.7,.2,1));
}
@keyframes vors-consent-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .vors-consent { animation: none; } }
.vors-consent__text {
  flex: 1 1 340px; margin: 0; max-width: 760px;
  font-family: var(--font-body, system-ui); font-weight: 400;
  font-size: 13px; line-height: 1.55; color: var(--titanium-dim);
}
.vors-consent__text a {
  color: var(--titanium); text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
  transition: border-color .3s var(--ease-out, ease);
}
.vors-consent__text a:hover { border-color: var(--signal); }
.vors-consent__actions { display: flex; gap: 12px; flex: 0 0 auto; }
.vors-consent__btn {
  font-family: var(--font-mono, monospace); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  padding: 11px 22px; border: 1px solid var(--line);
  background: transparent; color: var(--titanium-dim);
  transition: color .3s var(--ease-out, ease), border-color .3s var(--ease-out, ease), background .3s var(--ease-out, ease);
}
.vors-consent__btn:hover { color: var(--titanium); border-color: var(--titanium-dim); }
.vors-consent__btn--accept {
  color: var(--void); background: var(--signal); border-color: var(--signal);
}
.vors-consent__btn--accept:hover {
  background: var(--signal-deep); border-color: var(--signal-deep); color: var(--titanium);
}
@media (max-width: 560px) {
  .vors-consent { flex-direction: column; align-items: stretch; gap: 14px; }
  /* In the column direction the desktop `flex-basis: 340px` becomes HEIGHT,
     inflating the text block with ~240px of dead space — reset it. */
  .vors-consent__text { flex: 0 0 auto; }
  .vors-consent__btn { flex: 1; }
}
/* Privacy link injected into every footer (persistent re-consent access).
   flex-basis:100% drops it onto its own line under the engine footer's
   columns; on the static footers it simply sits below as a block. */
.vors-consent-footlink {
  flex-basis: 100%; margin-top: 20px;
  font-family: var(--font-mono, monospace); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase;
}
.vors-consent-footlink a {
  color: var(--titanium-mute); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: color .3s var(--ease-out, ease), border-color .3s var(--ease-out, ease);
}
.vors-consent-footlink a:hover { color: var(--titanium); border-color: var(--signal); }
