﻿/* =========================================================
   R-CODING — intro (3D loading screen), samo na početnoj
   Namjerno taman i filmski; ostatak sajta je svijetao.
   ========================================================= */
#rc-intro {
  --green: #2BD18F; --green-dark: #0A704B; --text: #F3F5F2; --muted: #A0ABAA; --red: #F2665B; --amber: #F5B748;
  --font: "Arimo", "Liberation Sans", Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --t-fast: 150ms; --gutter: clamp(16px, 4vw, 32px); --on-green: #06110C;
}
   INTRO — cinematic 3D loading screen
   ========================================================= */
html.rc-intro { overflow: hidden; }
html.rc-intro::after { content: ""; position: fixed; inset: 0; background: #050809; z-index: 9998; }
#rc-intro {
  position: fixed; inset: 0; z-index: 9999; background: #050809; color: var(--text); overflow: hidden;
  font-family: var(--mono); user-select: none; will-change: opacity;
  transition: opacity 900ms var(--ease-out), visibility 0s linear 900ms;
}
#rc-intro.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.rci-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.1s ease, transform 1s var(--ease-out); }
#rc-intro.is-ready .rci-canvas { opacity: 1; }
#rc-intro.is-leaving .rci-canvas { transform: scale(1.08); }
.rci-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 52%, transparent 45%, rgba(0,0,0,.78) 100%); }
.rci-grain {
  /* bez mix-blend-mode: blend preko WebGL canvasa je skup za svaki frejm */
  position: absolute; inset: -50%; pointer-events: none; opacity: .045; will-change: transform;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: rci-grain .6s steps(4) infinite;
}
@keyframes rci-grain { 0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); } 50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-1%); } 100% { transform: translate(0,0); } }

/* letterbox trake */
.rci-bar-top, .rci-bar-bot { position: absolute; left: 0; right: 0; height: 9vh; background: #000; z-index: 3; transition: transform 1s var(--ease-out); }
.rci-bar-top { top: 0; }
.rci-bar-bot { bottom: 0; }
#rc-intro.is-leaving .rci-bar-top { transform: translateY(-100%); }
#rc-intro.is-leaving .rci-bar-bot { transform: translateY(100%); }

/* HUD */
.rci-hud { position: absolute; inset: 0; z-index: 4; pointer-events: none; --pad: clamp(16px, 4vw, 48px); transition: opacity .6s ease; will-change: transform, opacity; }
.rci-bar-top, .rci-bar-bot, .rci-vignette { will-change: transform, opacity; }
#rc-intro.is-leaving .rci-hud { opacity: 0; }
.rci-c { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(43, 209, 143, .7); }
.rci-tl { top: calc(9vh + 18px); left: var(--pad); border-top-width: 2px; border-left-width: 2px; }
.rci-tr { top: calc(9vh + 18px); right: var(--pad); border-top-width: 2px; border-right-width: 2px; }
.rci-bl { bottom: calc(9vh + 18px); left: var(--pad); border-bottom-width: 2px; border-left-width: 2px; }
.rci-br { bottom: calc(9vh + 18px); right: var(--pad); border-bottom-width: 2px; border-right-width: 2px; }
.rci-head {
  position: absolute; top: 0; left: var(--pad); right: calc(var(--pad) + 120px); height: 9vh;
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #8E9A98;
}
.rci-tag { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.rci-tag svg { width: 18px; height: auto; fill: var(--green); }
.rci-tag b { color: var(--green); font-weight: 400; }
.rci-status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rci-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
#rc-intro.is-linked .rci-status i { background: var(--green); box-shadow: 0 0 10px var(--green); animation: rci-pulse 1.2s ease-in-out infinite; }
#rc-intro.is-linked .rci-status { color: var(--green); }
@keyframes rci-pulse { 50% { opacity: .35; } }

/* obrtomjer (indikator učitavanja) */
.rci-gauge {
  position: absolute; left: 50%; bottom: calc(9vh + 14px); width: clamp(210px, 21vw, 280px);
  transform: translateX(-50%); text-align: center;
  opacity: 0;
  transition: opacity .6s ease, transform .8s var(--ease-out);
  will-change: transform, opacity; contain: layout style;
}
/* obrtomjer se pojavljuje tek kad je 3D scena spremna (sakriva početno kompajliranje) */
#rc-intro.is-hud .rci-gauge { animation: rci-gauge-in 1s var(--ease-out) forwards; }
@keyframes rci-gauge-in { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
.rci-gauge::before {
  content: ""; position: absolute; left: -30%; right: -30%; top: -25%; bottom: -30%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(3,6,7,.82), rgba(3,6,7,.5) 55%, transparent);
}
.rci-gauge svg { width: 100%; height: auto; overflow: visible; }
.g-track { fill: none; stroke: rgba(243,245,242,.08); stroke-width: 3; }
/* sjaj je napravljen debljim prozirnim potezom, ne CSS filterom (filter se iscrtava svaki frejm) */
.g-fill { fill: none; stroke: url(#rciG); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.g-fill-glow { stroke-width: 9; opacity: .18; }
.g-red { fill: none; stroke: rgba(242,102,91,.45); stroke-width: 3; transition: stroke .2s ease, stroke-width .2s ease; }
.g-tick { stroke: rgba(243,245,242,.22); stroke-width: 1; }
.g-tick-major { stroke: rgba(243,245,242,.7); stroke-width: 1.6; }
.g-tick-red { stroke: rgba(242,102,91,.85); stroke-width: 1.4; }
.g-num { fill: #7E8A88; font-family: var(--mono); font-size: 7.5px; text-anchor: middle; }
.g-needle line { stroke: #F3F5F2; stroke-width: 2.2; stroke-linecap: round; transition: stroke .15s ease; }
.g-needle line.g-needle-glow { stroke: var(--green); stroke-width: 7; opacity: .25; }
.g-hub { fill: #0C1113; stroke: rgba(243,245,242,.6); stroke-width: 1.5; }
.rci-read {
  position: absolute; left: 0; right: 0; bottom: 14%; display: flex; justify-content: center; align-items: baseline; gap: 2px;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.rci-pct { font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; letter-spacing: -.03em; color: #F3F5F2; line-height: 1; transition: color .15s ease; }
.rci-unit { font-size: 13px; color: var(--green); font-weight: 700; }
.rci-line { margin: 10px 0 0; height: 16px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #8E9A98; white-space: nowrap; }
.rci-line-t { display: inline-block; transition: opacity .16s ease, transform .3s var(--ease-out); }
.rci-line-t.is-out { opacity: 0; transform: translateY(5px); }
.rci-line-t.is-final { color: var(--green); font-weight: 700; }
/* crvena zona pri startu motora */
#rc-intro.is-redline .g-red { stroke: #FF4D4D; stroke-width: 5; }
#rc-intro.is-redline .g-needle line { stroke: #FF5A4E; }
#rc-intro.is-redline .g-needle line.g-needle-glow { stroke: #FF4D4D; opacity: .4; }
#rc-intro.is-redline .rci-pct { color: #FF6B5E; }
#rc-intro.is-redline .rci-gauge svg { animation: rci-buzz .07s linear infinite; }
@keyframes rci-buzz { 0% { transform: none; } 50% { transform: translate(1px, -1px); } 100% { transform: none; } }
#rc-intro.is-brand .rci-gauge { opacity: 0; transform: translateX(-50%) translateY(16px); animation: none; }
/* start: trzaj HUD-a i trake se malo razmaknu */
#rc-intro.is-launch .rci-hud { animation: rci-jolt .5s var(--ease-out) both; }
#rc-intro.is-launch .rci-bar-top { transform: translateY(-35%); }
#rc-intro.is-launch .rci-bar-bot { transform: translateY(35%); }
#rc-intro.is-launch .rci-vignette { animation: rci-punch .9s ease-out both; }
@keyframes rci-jolt { 0% { transform: none; } 15% { transform: translate(-6px, 3px); } 35% { transform: translate(5px, -2px); } 60% { transform: translate(-2px, 1px); } 100% { transform: none; } }
@keyframes rci-punch { 0% { opacity: 1; } 20% { opacity: .55; } 100% { opacity: 1; } }

/* uvod koji je vidljiv odmah (dok se 3D priprema) */
.rci-pre { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; transition: opacity .7s ease, transform .9s var(--ease-out); }
.rci-pre svg { width: clamp(70px, 9vw, 120px); height: auto; overflow: visible; }
.rci-pre path { fill: rgba(43,209,143,0); stroke: #2BD18F; stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; animation: rci-draw 1.1s var(--ease-out) forwards, rci-fill .6s ease .9s forwards; }
.rci-pre span { position: absolute; left: 50%; top: 50%; width: 46vmin; height: 46vmin; margin: -23vmin 0 0 -23vmin; border-radius: 50%; background: radial-gradient(closest-side, rgba(43,209,143,.16), transparent 70%); animation: rci-breathe 2.2s ease-in-out infinite; }
@keyframes rci-draw { to { stroke-dashoffset: 0; } }
@keyframes rci-fill { to { fill: rgba(43,209,143,.9); } }
@keyframes rci-breathe { 50% { transform: scale(1.12); opacity: .6; } }
#rc-intro.is-pre-done .rci-pre { opacity: 0; transform: scale(1.15); }

/* logo reveal */
.rci-brand {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; font-family: var(--font);
}
.rci-brand svg { width: clamp(60px, 7vw, 92px); height: auto; fill: var(--green); opacity: 0; transform: scale(.82) translateY(10px); filter: drop-shadow(0 0 22px rgba(43,209,143,.65)); transition: opacity .7s ease, transform 1s var(--ease-out); }
/* animira se samo transform + opacity (letter-spacing bi tjerao layout u svakom frejmu) */
.rci-brand svg, .rci-brand strong, .rci-brand p { will-change: transform, opacity; }
.rci-brand strong { margin-top: 22px; font-size: clamp(30px, 5vw, 60px); font-weight: 700; letter-spacing: .16em; margin-right: -.16em; opacity: 0; transform: scale(1.18); transition: transform 1.3s var(--ease-out), opacity .8s ease .1s; text-shadow: 0 0 40px rgba(0,0,0,.6); }
.rci-brand p { margin-top: 14px; font-size: clamp(15px, 1.6vw, 19px); color: #C8D0CE; opacity: 0; transform: translateY(8px); transition: opacity .7s ease .35s, transform .9s var(--ease-out) .35s; }
#rc-intro.is-brand .rci-brand svg { opacity: 1; transform: none; }
#rc-intro.is-brand .rci-brand strong { opacity: 1; transform: none; }
#rc-intro.is-brand .rci-brand p { opacity: 1; transform: none; }
#rc-intro.is-leaving .rci-brand { transform: scale(1.04); transition: transform .9s var(--ease-out); }

.rci-skip {
  position: absolute; z-index: 6; top: 0; right: var(--gutter); height: 9vh; min-height: 44px;
  display: inline-flex; align-items: center; gap: 8px; padding: 0 4px;
  background: none; border: 0; cursor: pointer; color: #8E9A98;
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  transition: color var(--t-fast) ease;
}
.rci-skip:hover { color: var(--text); }

@media (max-width: 640px) {
  .rci-head { right: calc(var(--pad) + 96px); }
  .rci-status, .rci-tag-sub { display: none; }
  .rci-tag { letter-spacing: .14em; font-size: 11px; }
  .rci-gauge { width: 220px; }
  .rci-line { font-size: 10px; letter-spacing: .16em; }
}

@media (prefers-reduced-motion: reduce) { #rc-intro *, #rc-intro *::before, #rc-intro *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- brojač v2: odometar, osvijetljena skala, shift lampice ---------- */
.rci-gauge { width: clamp(230px, 23vw, 320px); }
.rci-pct { display: inline-flex; font-size: clamp(30px, 3vw, 40px); }
.rd { display: inline-block; height: 1em; overflow: hidden; line-height: 1; transition: opacity .3s ease, width .3s ease; }
.rd.is-lead { opacity: .18; }
.rd-c { display: flex; flex-direction: column; will-change: transform; transition: transform .38s cubic-bezier(.2,.9,.25,1); }
.rd-c i { font-style: normal; height: 1em; line-height: 1; text-align: center; width: .62em; }
.rci-read { flex-wrap: wrap; row-gap: 2px; bottom: 18%; }
.rci-rpm { flex-basis: 100%; font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: #6E7A79; }
.rci-rpm b { color: #CFD6D4; font-weight: 700; }
.g-tick.on, .g-tick-major.on { stroke: #2BD18F; }
.g-tick-red.on { stroke: #FF4D4D; stroke-width: 2.2; }
.g-num { transition: fill .2s ease; }
.g-tip { fill: #fff; }
#rc-intro.is-redline .g-tip { fill: #FF5A4E; }
/* shift lampice (kao kod trkačkih auta) */
.rci-shift { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.rci-shift i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: background-color .12s ease, box-shadow .12s ease; }
.rci-shift i.on:nth-child(-n+2) { background: #2BD18F; box-shadow: 0 0 10px rgba(43,209,143,.8); }
.rci-shift i.on:nth-child(n+3):nth-child(-n+4) { background: #F5B748; box-shadow: 0 0 10px rgba(245,183,72,.8); }
.rci-shift i.on:nth-child(n+5):nth-child(-n+6) { background: #FF4D4D; box-shadow: 0 0 10px rgba(255,77,77,.85); }
.rci-shift i.on:nth-child(7) { background: #5FA2FF; box-shadow: 0 0 12px rgba(95,162,255,.9); }
#rc-intro.is-redline .rci-shift i { animation: rci-shift-flash .16s steps(1) infinite; }
@keyframes rci-shift-flash { 50% { background: rgba(255,255,255,.06); box-shadow: none; } }
@media (max-width: 600px) { .rci-gauge { width: 240px; } .rci-shift i { width: 8px; height: 8px; } }
