:root {
  color-scheme: dark;
  --bg: #06060b;
  --ink: #f2f1ea;
  --muted: #a9a8b8;
  --line: rgba(242, 241, 234, 0.16);
  --card: rgba(14, 14, 22, 0.74);
  --liquid: #c8e020;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* the inner universe: slow nebulae behind, stars and neurons on the canvas above them */
body::before {
  content: ""; position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 20% 14%, rgba(96, 74, 210, 0.46), transparent 70%),
    radial-gradient(55vw 55vh at 84% 32%, rgba(20, 130, 145, 0.36), transparent 70%),
    radial-gradient(70vw 60vh at 50% 100%, rgba(160, 60, 130, 0.32), transparent 70%),
    var(--bg);
  animation: disanje 26s ease-in-out infinite alternate;
}
@keyframes disanje {
  from { transform: scale(1) rotate(0deg); opacity: 0.82; }
  to { transform: scale(1.08) rotate(2deg); opacity: 1; }
}
#svemir { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* navigation */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 960px; margin: 0 auto; padding: 18px 20px;
  font-family: var(--sans); font-size: 15px;
}
.nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: 0.02em; }
.nav .brand svg { width: 44px; height: 22px; }
.nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav ul a { text-decoration: none; color: var(--muted); }
.nav ul a:hover, .nav ul a[aria-current="page"] { color: var(--ink); }

/* hero */
.hero { position: relative; text-align: center; padding: 12vh 20px 9vh; min-height: 86vh; display: flex; flex-direction: column; justify-content: center; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: 34%; width: min(720px, 96vw); height: 320px;
  transform: translate(-50%, -50%); pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 224, 32, 0.16), transparent 70%);
  animation: dusa 7s ease-in-out infinite alternate;
}
@keyframes dusa { from { opacity: 0.45; } to { opacity: 1; } }
.hero .vial { width: min(640px, 92vw); height: auto; display: block; margin: 0 auto 34px; overflow: visible; }
.vial .tube { fill: rgba(200, 224, 32, 0.07); stroke: var(--ink); stroke-width: 3; }
.vial .tick { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; transition: stroke .5s, stroke-width .5s; }
.vial .halo { fill: rgba(200, 224, 32, 0.16); }
.vial .bubble { fill: var(--liquid); }
.hero.ravno .vial .tick { stroke: var(--liquid); stroke-width: 5; }
.hero h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(44px, 9vw, 88px); letter-spacing: 0.02em; line-height: 1; margin: 0 0 12px; }
.kod { font-family: var(--mono); font-size: 16px; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 28px; }
.slogan { font-size: clamp(21px, 3.4vw, 28px); font-style: italic; margin: 0 0 14px; }
.stanje {
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--liquid); min-height: 1.4em; margin: 0; opacity: 0; transition: opacity .8s;
}
.hero.ravno .stanje { opacity: 1; }

/* sections */
section { padding: 44px 0; }
h2 { font-family: var(--sans); font-weight: 600; font-size: 28px; letter-spacing: 0.005em; line-height: 1.2; margin: 0 0 18px; }
h3 { font-family: var(--sans); font-size: 19px; margin: 30px 0 8px; }
p { margin: 0 0 18px; }
.lead { font-size: 22px; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-family: var(--sans); font-size: 14px; }

/* the level motif above every section heading */
.razina { position: relative; width: 120px; height: 14px; margin: 0 0 22px; }
.razina::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: var(--muted); }
.razina::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 14px; margin-left: -11px;
  border-left: 1px solid var(--ink); border-right: 1px solid var(--ink);
}
.razina i {
  position: absolute; top: 2px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--liquid); box-shadow: 0 0 12px rgba(200, 224, 32, 0.7); transform: translateX(var(--pomak, 0px));
}

/* reveal on scroll */
.js .pojavi { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.js .pojavi.vidljivo { opacity: 1; transform: none; }

/* proposal list */
.popis { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.popis li { border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .3s; }
.popis a, .popis .ceka { display: block; padding: 20px 22px; text-decoration: none; }
.popis li:has(a:hover) { border-color: var(--liquid); }
.popis .br { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; color: var(--muted); display: block; margin-bottom: 4px; }
.popis .naslov { font-family: var(--sans); font-size: 21px; font-weight: 600; display: block; line-height: 1.3; }
.popis .opis { display: block; color: var(--muted); font-size: 17px; margin-top: 6px; }
.popis .ceka { color: var(--muted); }

/* numbered steps */
.koraci { counter-reset: k; list-style: none; margin: 0; padding: 0; }
.koraci li { counter-increment: k; position: relative; padding: 0 0 14px 44px; }
.koraci li::before {
  content: counter(k); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--muted); font-family: var(--sans); font-size: 14px; display: grid; place-items: center;
}

/* article */
article h1 { font-family: var(--sans); font-weight: 600; font-size: clamp(32px, 6vw, 46px); letter-spacing: -0.01em; line-height: 1.12; margin: 6px 0 14px; }
article .meta { font-family: var(--sans); font-size: 14px; color: var(--muted); margin: 0 0 30px; }
article ol, article ul { padding-left: 24px; margin: 0 0 18px; }
article li { margin-bottom: 8px; }
.okvir { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 20px 22px; margin: 26px 0; }
.okvir p:last-child { margin-bottom: 0; }
.izvori { font-family: var(--sans); font-size: 15px; line-height: 1.5; }
.izvori li { margin-bottom: 10px; overflow-wrap: anywhere; }
blockquote { margin: 30px 0; padding: 0 0 0 20px; border-left: 2px solid var(--liquid); font-size: 23px; font-style: italic; line-height: 1.45; }

/* footer */
footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0 60px; font-family: var(--sans); font-size: 15px; color: var(--muted); }
footer .potpis { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--mono); letter-spacing: 0.08em; margin-top: 16px; }
footer .potpis svg { width: 56px; height: 28px; }

/* download button */
a.gumb {
  display: inline-block; font-family: var(--sans); font-size: 16px; font-weight: 600; text-decoration: none;
  color: #0b0b0b; background: var(--liquid); border-radius: 10px; padding: 11px 18px;
}
a.gumb:hover { filter: brightness(1.08); }

/* commands and prompts to copy */
code { font-family: var(--mono); font-size: 0.86em; background: rgba(242, 241, 234, 0.08); padding: 1px 5px; border-radius: 5px; }
.naredba { position: relative; margin: 10px 0 18px; }
.naredba pre {
  margin: 0; padding: 14px 16px; padding-right: 96px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(8, 8, 14, 0.82); font-family: var(--mono); font-size: 14.5px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.naredba button {
  position: absolute; top: 9px; right: 9px; font-family: var(--sans); font-size: 13px; cursor: pointer;
  color: var(--ink); background: rgba(242, 241, 234, 0.08); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px;
}
.naredba button:hover { border-color: var(--liquid); }
.naredba button.kopirano { color: #0b0b0b; background: var(--liquid); border-color: var(--liquid); }
article ul li, article ol li { margin-bottom: 8px; }

/* entrance: point of light, tilted horizon, tube drawn around it, bubble finds the middle */
.vial .obzor { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; }
.vial .val { fill: none; stroke: var(--liquid); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.vial .val.ide { animation: val 1.7s ease-out forwards; }
@keyframes val { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(11); } }
@keyframes rodi { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes obzor { from { transform: scaleX(0); opacity: 1; } to { transform: scaleX(1); opacity: 1; } }
@keyframes nestani { to { opacity: 0; } }
@keyframes crtaj { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes puni { from { fill-opacity: 0; } to { fill-opacity: 1; } }
.ulaz-crta .vial .bubble, .ulaz-crta .vial .halo { transform-box: fill-box; transform-origin: center; animation: rodi 0.9s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.ulaz-crta .vial .obzor { animation: obzor 0.7s 0.45s ease-out both, nestani 0.6s 1.5s ease-in forwards; }
.ulaz-crta .vial .tube { stroke-dasharray: 1; animation: crtaj 1.1s 1s ease-in-out both, puni 0.9s 1.9s ease both; }
.ulaz-crta .vial .tick { stroke-dasharray: 1; animation: crtaj 0.45s 1.9s ease-out both; }
.ulaz-crta .vial .tick + .tick { animation-delay: 2.05s; }
.preskoci .vial * { animation: none !important; }

.js .nav, .js .hero h1, .js .hero .kod, .js .hero .slogan, .js main > .wrap, .js footer { transition: opacity 1.1s ease, transform 1.1s ease; }
.ulaz .nav, .ulaz .hero h1, .ulaz .hero .kod, .ulaz .hero .slogan, .ulaz main > .wrap, .ulaz footer { opacity: 0; }
.ulaz .hero h1, .ulaz .hero .kod, .ulaz .hero .slogan { transform: translateY(14px); }
.gotovo .hero .kod { transition-delay: 0.15s; }
.gotovo .hero .slogan { transition-delay: 0.3s; }
.gotovo .nav { transition-delay: 0.5s; }
.gotovo main > .wrap, .gotovo footer { transition-delay: 0.6s; }

/* the small logo: the bubble slides in and settles on load, and wobbles on hover */
.brand ellipse, .potpis ellipse { transform-box: fill-box; transform-origin: center; }
.brand ellipse { animation: sjedni 1.8s ease-out both; }
.brand:hover ellipse, .potpis:hover ellipse { animation: klizi 1.4s ease-in-out; }
@keyframes sjedni { 0% { transform: translateX(-30px); } 50% { transform: translateX(9px); } 78% { transform: translateX(-4px); } 100% { transform: none; } }
@keyframes klizi { 0% { transform: none; } 30% { transform: translateX(24px); } 62% { transform: translateX(-13px); } 84% { transform: translateX(5px); } 100% { transform: none; } }

@media (max-width: 560px) {
  body { font-size: 18px; }
  .nav { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 78vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before, .hero::before { animation: none; }
  .js .pojavi { opacity: 1; transform: none; transition: none; }
  .stanje, .vial .tick { transition: none; }
  .brand ellipse, .potpis ellipse, .vial * { animation: none !important; }
}
